mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
trims strings by copying them, to avoid retaining excessively large strings.
This commit is contained in:
parent
9bc9544d23
commit
b69d93c128
@ -45,7 +45,8 @@ class StringTable {
|
||||
public String intern(String str) {
|
||||
String result = (String) strings.get(str);
|
||||
if (result == null) {
|
||||
result = str;
|
||||
// copy the string, to trim to minimum size.
|
||||
result = str = new String(str);
|
||||
strings.put(str, str);
|
||||
}
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user