Author: Ronan Lamy <[email protected]>
Branch: py3k
Changeset: r85927:33a4f0d155b6
Date: 2016-07-30 14:27 +0100
http://bitbucket.org/pypy/pypy/changeset/33a4f0d155b6/
Log: Port ac03886 to py3k
diff --git a/pypy/objspace/descroperation.py b/pypy/objspace/descroperation.py
--- a/pypy/objspace/descroperation.py
+++ b/pypy/objspace/descroperation.py
@@ -446,17 +446,14 @@
from pypy.objspace.std.intobject import (
W_AbstractIntObject, W_IntObject)
- if type(w_result) is W_IntObject:
- if space.int_w(w_result) == -1:
- return space.wrap(-2)
- return w_result
if not isinstance(w_result, W_IntObject):
# a non W_IntObject int, assume long-like
assert isinstance(w_result, W_AbstractIntObject)
w_result = w_result.descr_hash(space)
result = space.int_w(w_result)
- if result == -1:
- result = -2
+ # turn -1 into -2 without using a condition, which would
+ # create a potential bridge in the JIT
+ result -= (result == -1)
return space.newint(result)
def issubtype_w(space, w_sub, w_type):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit