This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
PATCH to process_gcj_properties
- From: Per Bothner <per at bothner dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Sun, 26 Sep 2004 13:28:21 -0700
- Subject: PATCH to process_gcj_properties
I don't know if this actually makes a difference in generated code,
and it certainly would only save a few bytes of memory. But for some
reason I made this change a while ago, and since it microscopically
simplifies the source code, I figure I might as well check it in.
So I checked it into mainline.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
2004-09-26 Per Bothner <per@bothner.com>
* prims.cc (process_gcj_properties): Optimization.
Index: prims.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/prims.cc,v
retrieving revision 1.97
diff -u -p -r1.97 prims.cc
--- prims.cc 23 Aug 2004 21:31:53 -0000 1.97
+++ prims.cc 26 Sep 2004 20:20:17 -0000
@@ -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