Skip to content

Commit d2ee60a

Browse files
committed
Reverted change in int.__hash__() for PythonNativeVoidPtr
1 parent d5b2022 commit d2ee60a

File tree

1 file changed

+2
-15
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/ints

1 file changed

+2
-15
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/ints/IntBuiltins.java

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,22 +2661,9 @@ long hash(PInt self) {
26612661
}
26622662

26632663
@Specialization
2664-
long hash(PythonNativeVoidPtr self,
2665-
@CachedLibrary(limit = "1") InteropLibrary lib) {
2666-
if (lib.isPointer(self.object)) {
2667-
try {
2668-
long ptrVal = lib.asPointer(self.object);
2669-
return PythonObjectLibrary.hash(ptrVal);
2670-
} catch (UnsupportedMessageException e) {
2671-
// fall through
2672-
}
2673-
}
2674-
return doHashCode(self.object);
2675-
}
2676-
26772664
@TruffleBoundary
2678-
long doHashCode(Object o) {
2679-
return o.hashCode();
2665+
long hash(PythonNativeVoidPtr self) {
2666+
return self.object.hashCode();
26802667
}
26812668

26822669
}

0 commit comments

Comments
 (0)