changeset 30640:3dba338b5d00

8061254: SPECjvm2008-XML performance regressions in 9-b33 Reviewed-by: alanb, shade
author redestad
date Fri, 15 May 2015 16:09:55 +0200
parents 4915246064b2
children 701f6f90dc0b
files jdk/src/java.base/share/classes/java/lang/String.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;
     }