Author: rolf
Date: 2007-06-06 10:24:31 -0400 (Wed, 06 Jun 2007)
New Revision: 78744

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/runtime.cpp
   trunk/moon/src/runtime.h
Log:
2007-06-06  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>

        * runtime.cpp, runtime.h: Remove the default_values hashtable
        from DependencyObject, it's redundant since the default value
        is stored inside the DependencyProperty anyway.



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-06-06 14:06:46 UTC (rev 78743)
+++ trunk/moon/src/ChangeLog    2007-06-06 14:24:31 UTC (rev 78744)
@@ -1,3 +1,9 @@
+2007-06-06  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>
+
+       * runtime.cpp, runtime.h: Remove the default_values hashtable
+       from DependencyObject, it's redundant since the default value
+       is stored inside the DependencyProperty anyway.
+
 2007-06-06  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * demo.cpp: Adapted to API changes.

Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp  2007-06-06 14:06:46 UTC (rev 78743)
+++ trunk/moon/src/runtime.cpp  2007-06-06 14:24:31 UTC (rev 78744)
@@ -511,7 +511,6 @@
        DependencyObject
 */
 
-GHashTable *DependencyObject::default_values = NULL;
 GHashTable *DependencyObject::properties = NULL;
 
 typedef struct {
@@ -576,24 +575,13 @@
 DependencyObject::GetValue (DependencyProperty *property)
 {
        Value *value = NULL;
-       GHashTable * table = NULL;
 
        value = (Value *) g_hash_table_lookup (current_values, property->name);
 
        if (value != NULL)
                return value;
 
-       if (default_values == NULL)
-               return NULL;
-
-       table = (GHashTable*) g_hash_table_lookup (default_values, 
&property->type);
-       
-       if (table == NULL)
-               return NULL;
-
-       value = (Value *) g_hash_table_lookup (table, property->name);
-
-       return value;
+       return property->default_value;
 }
 
 DependencyObject::DependencyObject ()
@@ -679,9 +667,6 @@
 {
        GHashTable *table;
 
-       if (NULL == default_values)
-               default_values = g_hash_table_new (g_int_hash, g_int_equal);
-
        DependencyProperty *property = new DependencyProperty (name, 
default_value, vtype);
        property->type = type;
        
@@ -698,20 +683,6 @@
 
        g_hash_table_insert (table, property->name, property);
 
-
-       // now take care of inserting the default value
-       if (NULL == default_values)
-               default_values = g_hash_table_new (g_int_hash, g_int_equal);
-
-       table = (GHashTable*) g_hash_table_lookup (default_values, 
&property->type);
-
-       if (table == NULL) {
-               table = g_hash_table_new (g_str_hash, g_str_equal);
-               g_hash_table_insert (default_values, &property->type, table);
-       }
-
-       g_hash_table_insert (table, property->name, property->default_value);
-
        return property;
 }
 

Modified: trunk/moon/src/runtime.h
===================================================================
--- trunk/moon/src/runtime.h    2007-06-06 14:06:46 UTC (rev 78743)
+++ trunk/moon/src/runtime.h    2007-06-06 14:24:31 UTC (rev 78744)
@@ -328,9 +328,7 @@
  private:
        Type objectType;
        static GHashTable *properties;
-       static GHashTable *default_values;
        GHashTable        *current_values;
-
        GSList            *attached_list;
 };
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to