avoiding the String.getBytes() since its a bitch on gc (measured for this situation)

This commit is contained in:
jrandom
2004-06-19 23:32:41 +00:00
committed by zzz
parent de334b003d
commit 51e259c198

View File

@ -80,10 +80,15 @@ public class RoutingKeyGenerator {
today = _cal.getTime();
}
byte mod[] = null;
String modVal = null;
synchronized (_fmt) {
mod = _fmt.format(today).getBytes();
modVal = _fmt.format(today);
}
_log.info("Routing modifier generated: " + new String(mod));
mod = new byte[modVal.length()];
for (int i = 0; i < modVal.length(); i++)
mod[i] = (byte)(modVal.charAt(i) & 0xFF);
if (_log.shouldLog(Log.INFO))
_log.info("Routing modifier generated: " + modVal);
setModData(mod);
}