* prims.cc (process_gcj_properties): Optimization.
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 26 Sep 2004 20:24:32 +0000 (20:24 +0000)
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 26 Sep 2004 20:24:32 +0000 (20:24 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88147 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/prims.cc

index 2a68a96..1901c4a 100644 (file)
@@ -1,5 +1,9 @@
 2004-09-26  Per Bothner  <per@bothner.com>
 
+       * prims.cc (process_gcj_properties):  Optimization.
+
+2004-09-26  Per Bothner  <per@bothner.com>
+
        * java/util/Collections.java (sort):  Copy from array in forwards
        order, rather than reverse order which may be much less efficient.
 
index 285363f..7511906 100644 (file)
@@ -881,18 +881,15 @@ process_gcj_properties ()
     }
   memset ((void *) &_Jv_Environment_Properties[property_count], 
          0, sizeof (property_pair));
-  {
-    size_t i = 0;
 
-    // Null terminate the strings.
-    while (_Jv_Environment_Properties[i].key)
-      {
-        property_pair *prop = &_Jv_Environment_Properties[i];
-       prop->key[prop->key_length] = 0;
-       prop->value[prop->value_length] = 0;
-       i++;
-      }
-  }
+  // Null terminate the strings.
+  for (property_pair *prop = &_Jv_Environment_Properties[0];
+       prop->key != NULL;
+       prop++)
+    {
+      prop->key[prop->key_length] = 0;
+      prop->value[prop->value_length] = 0;
+    }
 }
 #endif // DISABLE_GETENV_PROPERTIES