Skip to content

Instantly share code, notes, and snippets.

@jruby
Created December 21, 2009 20:20
Show Gist options
  • Select an option

  • Save jruby/261207 to your computer and use it in GitHub Desktop.

Select an option

Save jruby/261207 to your computer and use it in GitHub Desktop.
public int hashCode() {
int h = hash;
if (h == 0) {
int off = offset;
char val[] = value;
int len = count;
for (int i = 0; i < len; i++) {
h = 31*h + val[off++];
}
hash = h;
}
return h;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment