Commit 612f15b6 authored by Douglas Miles's avatar Douglas Miles Committed by GitHub

Fix for ansi-test SXHASH.8

parent 5f6fc730
...@@ -416,6 +416,7 @@ public final class SimpleString extends AbstractString ...@@ -416,6 +416,7 @@ public final class SimpleString extends AbstractString
@Override @Override
public int sxhash() public int sxhash()
{ {
if(capacity == 0) return 0;
int hashCode = randomStringHashBase; int hashCode = randomStringHashBase;
for (int i = 0; i < capacity; i++) { for (int i = 0; i < capacity; i++) {
hashCode += chars[i]; hashCode += chars[i];
...@@ -432,6 +433,7 @@ public final class SimpleString extends AbstractString ...@@ -432,6 +433,7 @@ public final class SimpleString extends AbstractString
@Override @Override
public int psxhash() public int psxhash()
{ {
if(capacity == 0) return 0;
int hashCode = randomStringHashBase; int hashCode = randomStringHashBase;
for (int i = 0; i < capacity; i++) { for (int i = 0; i < capacity; i++) {
hashCode += Character.toUpperCase(chars[i]); hashCode += Character.toUpperCase(chars[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment