8061254: SPECjvm2008-XML performance regressions in 9-b33
authorredestad
Fri, 15 May 2015 16:09:55 +0200
changeset 30640 3dba338b5d00
parent 30531 4915246064b2
child 30641 701f6f90dc0b
8061254: SPECjvm2008-XML performance regressions in 9-b33 Reviewed-by: alanb, shade
jdk/src/java.base/share/classes/java/lang/String.java
--- a/jdk/src/java.base/share/classes/java/lang/String.java	Wed Jul 05 20:33:55 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/String.java	Fri May 15 16:09:55 2015 +0200
@@ -1473,7 +1473,9 @@
             for (char v : value) {
                 h = 31 * h + v;
             }
-            hash = h;
+            if (h != 0) {
+                hash = h;
+            }
         }
         return h;
     }