Am 16.04.2011 16:45, schrieb David Schlosnagle:
One minor nit in ProcessEnvironment.java

  336     private static void addToEnv(StringBuilder sb, String name,
String val) {
  337         sb.append(name+"="+val+'\u0000');
  338     }

I think it should be as follows to avoid implicitly constructing
another StringBuilder and the extra copying overhead;

  336     private static void addToEnv(StringBuilder sb, String name,
String val) {
  337         sb.append(name).append('=').append(val).append('\u0000');
  338     }


Because this suggestion was from me, I must admit, that I didn't prove, if javac actually uses the existing StringBuilder sb, or forces another StringBuilder to instantiate. I just assumed, javac would use the existing one. So to be done:
- examine the byte code
- if not yet optimized: then new RFE for javac

Sorry, if I was wrong.

-Ulf

Reply via email to