do not set attributes if they have their default value.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue, 11 Mar 2008 11:35:26 -0700
changeset 2591 83a605082fb6
parent 2590 4b09d2511d4f
child 2592 3ebf97150166
do not set attributes if they have their default value.
src/core/object.h
--- a/src/core/object.h	Tue Mar 11 11:35:03 2008 -0700
+++ b/src/core/object.h	Tue Mar 11 11:35:26 2008 -0700
@@ -751,15 +751,52 @@
               
 {
   AttributeList attributes;
+  if (n1 == "")
+    {
+      goto end;
+    }
   attributes.SetWithTid (T::GetTypeId (), n1, v1);
+  if (n2 == "")
+    {
+      goto end;
+    }
   attributes.SetWithTid (T::GetTypeId (), n2, v2);
+  if (n3 == "")
+    {
+      goto end;
+    }
   attributes.SetWithTid (T::GetTypeId (), n3, v3);
+  if (n4 == "")
+    {
+      goto end;
+    }
   attributes.SetWithTid (T::GetTypeId (), n4, v4);
+  if (n5 == "")
+    {
+      goto end;
+    }
   attributes.SetWithTid (T::GetTypeId (), n5, v5);
+  if (n6 == "")
+    {
+      goto end;
+    }
   attributes.SetWithTid (T::GetTypeId (), n6, v6);
+  if (n7 == "")
+    {
+      goto end;
+    }
   attributes.SetWithTid (T::GetTypeId (), n7, v7);
+  if (n8 == "")
+    {
+      goto end;
+    }
   attributes.SetWithTid (T::GetTypeId (), n8, v8);
+  if (n9 == "")
+    {
+      goto end;
+    }
   attributes.SetWithTid (T::GetTypeId (), n9, v9);
+ end:
   return CreateObject<T> (attributes);
 }