Skip to content

Instantly share code, notes, and snippets.

@dmitrybubyakin
Created March 17, 2015 20:59
Show Gist options
  • Save dmitrybubyakin/96f957f9617cd44abe08 to your computer and use it in GitHub Desktop.
Save dmitrybubyakin/96f957f9617cd44abe08 to your computer and use it in GitHub Desktop.
public int hashCode() {
int h = hash;
if (h == 0 && value.length > 0) {
char val[] = value;
for (int i = 0; i < value.length; i++) {
h = 31 * h + val[i];
}
hash = h;
}
return h;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment