]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/lazy.qh
Merge branch 'terencehill/menu_hudskin_selector' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / lazy.qh
index f632b38c32be69e446ba3a34e1183352bb27430b..5e0329bd206c21e4c94881bd8e947fea7afc51b2 100644 (file)
@@ -4,15 +4,19 @@
 #include "oo.qh"
 
 CLASS(Lazy, Object)
-    ATTRIB(Lazy, m_get, entity(), func_null);
-    CONSTRUCTOR(Lazy, entity() _compute) { this.m_get = _compute; }
+       ATTRIB(Lazy, m_get, entity(), func_null);
+       CONSTRUCTOR(Lazy, entity() _compute)
+       {
+               this.m_get = _compute;
+       }
 ENDCLASS(Lazy)
 
 #define LAZY(id) __lazy_##id
-#define LAZY_NEW(id, compute) entity LAZY(id)() { \
-    static bool done; \
-    static entity it; \
-    if (!done) { it = compute; done = true; } \
-    return it; \
-}
+#define LAZY_NEW(id, compute) \
+       entity LAZY(id)() { \
+               static bool done; \
+               static entity it; \
+               if (!done) { it = compute; done = true; } \
+               return it; \
+       }
 #endif