Commit aebaf39
authored
Fix invalid shift in PropertyIndex.hashCode (#4314)
This commit fixes a bug in `PropertyIndex.hashCode()` where a 32-bit integer was being shifted by 32 bits (`b >>> 32`). In Java, shifting an `int` by 32 is a no-op (mod 32), leading to `b ^ b` which results in 0. This caused the property values to be effectively ignored in the hash code calculation.
The fix removes the invalid shift and XOR operation, using the property hash code directly (`value = 31 * value + b`), which is the standard way to accumulate hash codes. This ensures that `PropertyIndex` objects with different property values have different hash codes.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent f4e9392 commit aebaf39
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
859 | 859 | | |
860 | 860 | | |
861 | 861 | | |
862 | | - | |
| 862 | + | |
863 | 863 | | |
864 | 864 | | |
865 | 865 | | |
| |||
0 commit comments