[pypy-svn] pypy default: ll_find should be inlined.
alex_gaynor
commits-noreply at bitbucket.org
Sat Mar 12 23:14:58 CET 2011
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch:
Changeset: r42544:81a38d2cd424
Date: 2011-03-12 17:14 -0500
http://bitbucket.org/pypy/pypy/changeset/81a38d2cd424/
Log: ll_find should be inlined.
diff --git a/pypy/rpython/lltypesystem/rstr.py b/pypy/rpython/lltypesystem/rstr.py
--- a/pypy/rpython/lltypesystem/rstr.py
+++ b/pypy/rpython/lltypesystem/rstr.py
@@ -515,7 +515,6 @@
return count
@classmethod
- @purefunction
def ll_find(cls, s1, s2, start, end):
if start < 0:
start = 0
@@ -529,11 +528,10 @@
return start
elif m == 1:
return cls.ll_find_char(s1, s2.chars[0], start, end)
-
+
return cls.ll_search(s1, s2, start, end, FAST_FIND)
@classmethod
- @purefunction
def ll_rfind(cls, s1, s2, start, end):
if start < 0:
start = 0
@@ -547,11 +545,10 @@
return end
elif m == 1:
return cls.ll_rfind_char(s1, s2.chars[0], start, end)
-
+
return cls.ll_search(s1, s2, start, end, FAST_RFIND)
@classmethod
- @purefunction
def ll_count(cls, s1, s2, start, end):
if start < 0:
start = 0
@@ -565,7 +562,7 @@
return end - start + 1
elif m == 1:
return cls.ll_count_char(s1, s2.chars[0], start, end)
-
+
res = cls.ll_search(s1, s2, start, end, FAST_COUNT)
# For a few cases ll_search can return -1 to indicate an "impossible"
# condition for a string match, count just returns 0 in these cases.
More information about the Pypy-commit
mailing list