diff dwt/accessibility/AccessibleObject.d @ 104:62a654ba5276

optimation of static ctors
author Frank Benoit <benoit@tionex.de>
date Fri, 18 Jan 2008 19:13:47 +0100
parents 5899e0b43e5d
children de2578a843a7
line wrap: on
line diff
--- a/dwt/accessibility/AccessibleObject.d	Fri Jan 18 17:00:39 2008 +0100
+++ b/dwt/accessibility/AccessibleObject.d	Fri Jan 18 19:13:47 2008 +0100
@@ -54,14 +54,17 @@
     static /*const*/ uint ATK_SELECTION_TYPE;
     static /*const*/ uint ATK_TEXT_TYPE;
     static /*const*/ bool DEBUG;
+    static bool static_this_completed = false;
 
-    public static void static_this() {
+    package static void static_this() {
+        if( static_this_completed ) return;
         DEBUG = Display.DEBUG;
         ATK_ACTION_TYPE = ATK.g_type_from_name ("AtkAction");
         ATK_COMPONENT_TYPE = ATK.g_type_from_name ("AtkComponent");
         ATK_HYPERTEXT_TYPE = ATK.g_type_from_name ("AtkHypertext");
         ATK_SELECTION_TYPE = ATK.g_type_from_name ("AtkSelection");
         ATK_TEXT_TYPE = ATK.g_type_from_name ("AtkText");
+        static_this_completed = true;
     }
 
     this (int /*long*/ type, GtkWidget* widget, Accessible accessible, int /*long*/ parentType, bool isLightweight) {