Skip to content

Instantly share code, notes, and snippets.

@NoNews
Last active May 12, 2020 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NoNews/47090aa7f6ff8eec2ae79129c4575b7a to your computer and use it in GitHub Desktop.
Save NoNews/47090aa7f6ff8eec2ae79129c4575b7a to your computer and use it in GitHub Desktop.
public V put(K key, V value) {
...
index = ~index; //NOT -1 = 0
...
mHashes[index] = hash;
mArray[index<<1] = key; //XOR 1 == 0
mArray[(index<<1)+1] = value; //XOR 1 + 1 == 1
return null //previous value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment