You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2021/07/05 00:04:22 UTC
[groovy] 01/02: Tweak `hash` for the hash join of GINQ
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 3e0c3e73916d73a52b44cd616cb063f41dcfc007
Author: Daniel Sun <su...@apache.org>
AuthorDate: Mon Jul 5 07:58:04 2021 +0800
Tweak `hash` for the hash join of GINQ
---
.../groovy/ginq/provider/collection/runtime/QueryableCollection.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableCollection.java b/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableCollection.java
index e2f3398..913bd49 100644
--- a/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableCollection.java
+++ b/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableCollection.java
@@ -160,7 +160,7 @@ class QueryableCollection<T> implements Queryable<T>, Serializable {
private static final int HASHTABLE_MAX_SIZE = SystemUtil.getIntegerSafe("groovy.ginq.hashtable.max.size", 128);
private static final int HASHTABLE_BUCKET_INITIAL_SIZE = SystemUtil.getIntegerSafe("groovy.ginq.hashtable.bucket.initial.size", 16);
private static Integer hash(Object obj) {
- return Objects.hash(obj) % HASHTABLE_MAX_SIZE; // mod `HASHTABLE_MAX_SIZE` to limit the size of hash table
+ return Integer.remainderUnsigned(Objects.hash(obj), HASHTABLE_MAX_SIZE); // mod `HASHTABLE_MAX_SIZE` to limit the size of hash table
}
@Override