Author: Manuel Jacob <[email protected]>
Branch:
Changeset: r90467:ce53039393d6
Date: 2017-03-02 11:17 +0100
http://bitbucket.org/pypy/pypy/changeset/ce53039393d6/
Log: space.is_true(space.eq(...)) -> space.eq_w(...) in interp_array.py.
It's slightly shorter and uses the identity check fast path.
diff --git a/pypy/module/array/interp_array.py
b/pypy/module/array/interp_array.py
--- a/pypy/module/array/interp_array.py
+++ b/pypy/module/array/interp_array.py
@@ -76,7 +76,7 @@
w_elem1 = arr1.w_getitem(space, i)
w_elem2 = arr2.w_getitem(space, i)
if comp_op == EQ:
- res = space.is_true(space.eq(w_elem1, w_elem2))
+ res = space.eq_w(w_elem1, w_elem2)
if not res:
return space.w_False
elif comp_op == NE:
@@ -90,7 +90,7 @@
res = space.is_true(space.gt(w_elem1, w_elem2))
if res:
return space.w_True
- elif not space.is_true(space.eq(w_elem1, w_elem2)):
+ elif not space.eq_w(w_elem1, w_elem2):
return space.w_False
else:
if comp_op == LE:
@@ -99,7 +99,7 @@
res = space.is_true(space.ge(w_elem1, w_elem2))
if not res:
return space.w_False
- elif not space.is_true(space.eq(w_elem1, w_elem2)):
+ elif not space.eq_w(w_elem1, w_elem2):
return space.w_True
# we have some leftovers
if comp_op == EQ:
@@ -266,7 +266,7 @@
for i in range(self.len):
# XXX jitdriver
w_item = self.w_getitem(space, i)
- if space.is_true(space.eq(w_item, w_val)):
+ if space.eq_w(w_item, w_val):
cnt += 1
return space.newint(cnt)
@@ -277,7 +277,7 @@
"""
for i in range(self.len):
w_item = self.w_getitem(space, i)
- if space.is_true(space.eq(w_item, w_x)):
+ if space.eq_w(w_item, w_x):
return space.newint(i)
raise oefmt(space.w_ValueError, "array.index(x): x not in list")
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit