Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
style: include RV_ABSOLUTE_VALUE_OF_HASHCODE
  • Loading branch information
vil02 committed Jul 2, 2024
commit 7d7e8f962f7afef1d65efdd8411a9cac888f3dc7
3 changes: 0 additions & 3 deletions spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@
<Match>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
</Match>
<Match>
<Bug pattern="RV_ABSOLUTE_VALUE_OF_HASHCODE" />
</Match>
<!-- fb-contrib -->
<Match>
<Bug pattern="OCP_OVERLY_CONCRETE_PARAMETER" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ public void put(K key, V value) {

// 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() {
Expand Down