style: include RV_ABSOLUTE_VALUE_OF_HASHCODE (#5273)

This commit is contained in:
Piotr Idzik
2024-07-02 21:47:35 +02:00
committed by GitHub
parent e63c39ac88
commit 5bc96cf789
2 changed files with 1 additions and 5 deletions

View File

@ -47,8 +47,7 @@ public class GenericHashMapUsingArray<K, V> {
// tells which bucket to go to
private int hashFunction(K key) {
int hc = key.hashCode();
return Math.abs(hc) % buckets.length;
return Math.floorMod(key.hashCode(), buckets.length);
}
private void reHash() {