[pypy-commit] pypy default: Clean up: min() is now RPython.

arigo noreply at buildbot.pypy.org
Wed Nov 2 17:00:55 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r48662:6cb0e75f39f9
Date: 2011-11-02 17:00 +0100
http://bitbucket.org/pypy/pypy/changeset/6cb0e75f39f9/

Log:	Clean up: min() is now RPython.

diff --git a/pypy/objspace/std/tupleobject.py b/pypy/objspace/std/tupleobject.py
--- a/pypy/objspace/std/tupleobject.py
+++ b/pypy/objspace/std/tupleobject.py
@@ -108,15 +108,10 @@
             return space.w_False
     return space.w_True
 
-def _min(a, b):
-    if a < b:
-        return a
-    return b
-
 def lt__Tuple_Tuple(space, w_tuple1, w_tuple2):
     items1 = w_tuple1.wrappeditems
     items2 = w_tuple2.wrappeditems
-    ncmp = _min(len(items1), len(items2))
+    ncmp = min(len(items1), len(items2))
     # Search for the first index where items are different
     for p in range(ncmp):
         if not space.eq_w(items1[p], items2[p]):
@@ -127,7 +122,7 @@
 def gt__Tuple_Tuple(space, w_tuple1, w_tuple2):
     items1 = w_tuple1.wrappeditems
     items2 = w_tuple2.wrappeditems
-    ncmp = _min(len(items1), len(items2))
+    ncmp = min(len(items1), len(items2))
     # Search for the first index where items are different
     for p in range(ncmp):
         if not space.eq_w(items1[p], items2[p]):


More information about the pypy-commit mailing list