提交 d894921f 编写于 作者: A alanb

6921374: java.lang.String::hashCode() should check for count == 0 to avoid repeated stores hash = 0

Reviewed-by: darcy, ohair
上级 02eba688
......@@ -1492,7 +1492,7 @@ public final class String
*/
public int hashCode() {
int h = hash;
if (h == 0) {
if (h == 0 && count > 0) {
int off = offset;
char val[] = value;
int len = count;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册