mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8004661: Comment and function name java_lang_String::toHash is wrong
Renamed to hash_code Reviewed-by: dholmes, coleenp, brutisso
This commit is contained in:
parent
1dff0005b9
commit
0ed52d16e2
3 changed files with 9 additions and 9 deletions
|
@ -327,14 +327,14 @@ jchar* java_lang_String::as_unicode_string(oop java_string, int& length) {
|
|||
return result;
|
||||
}
|
||||
|
||||
unsigned int java_lang_String::to_hash(oop java_string) {
|
||||
unsigned int java_lang_String::hash_code(oop java_string) {
|
||||
int length = java_lang_String::length(java_string);
|
||||
// Zero length string will hash to zero with String.toHash() function.
|
||||
// Zero length string will hash to zero with String.hashCode() function.
|
||||
if (length == 0) return 0;
|
||||
|
||||
typeArrayOop value = java_lang_String::value(java_string);
|
||||
int offset = java_lang_String::offset(java_string);
|
||||
return java_lang_String::to_hash(value->char_at_addr(offset), length);
|
||||
return java_lang_String::hash_code(value->char_at_addr(offset), length);
|
||||
}
|
||||
|
||||
char* java_lang_String::as_quoted_ascii(oop java_string) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue