mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8216049: stringTable::intern creates redundant String when looking up existing one
Reviewed-by: redestad, gziemski, rehn, zgu, jiangli
This commit is contained in:
parent
fcf50f8419
commit
7a86bc1c4f
1 changed files with 4 additions and 0 deletions
|
@ -334,6 +334,10 @@ oop StringTable::intern(Handle string_or_null_h, const jchar* name, int len, TRA
|
|||
if (StringTable::_alt_hash) {
|
||||
hash = hash_string(name, len, true);
|
||||
}
|
||||
found_string = StringTable::the_table()->do_lookup(name, len, hash);
|
||||
if (found_string != NULL) {
|
||||
return found_string;
|
||||
}
|
||||
return StringTable::the_table()->do_intern(string_or_null_h, name, len,
|
||||
hash, CHECK_NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue