Skip to content

Commit 0a3d354

Browse files
committed
Explain choice of rehash value
1 parent a2d6b5e commit 0a3d354

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

components/context/src/main/java/datadog/context/NoopContextScope.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public Context context() {
6868
public void close() {}
6969

7070
private static int rehash(int oldHash) {
71+
// scatter in both directions using value close to golden ratio
7172
return Integer.reverseBytes(oldHash * 0x9e3775cd) * 0x9e3775cd;
7273
}
7374
}

0 commit comments

Comments
 (0)