[Python-checkins] cpython: Remove local dead code. In both blocks dir is always greater 0.

christian.heimes python-checkins at python.org
Sat Apr 18 06:07:44 CEST 2015


https://hg.python.org/cpython/rev/bc1a178b3bc8
changeset:   95704:bc1a178b3bc8
user:        Christian Heimes <christian at python.org>
date:        Sat Apr 18 05:54:02 2015 +0200
summary:
  Remove local dead code. In both blocks dir is always greater 0.

files:
  Objects/bytearrayobject.c |  3 +--
  Objects/bytesobject.c     |  3 +--
  2 files changed, 2 insertions(+), 4 deletions(-)


diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -1171,10 +1171,9 @@
     /* Issue #23573: FIXME, windows has no memrchr() */
     else if (sub_len == 1 && dir > 0) {
         unsigned char needle = *sub;
-        int mode = (dir > 0) ? FAST_SEARCH : FAST_RSEARCH;
         res = stringlib_fastsearch_memchr_1char(
             PyByteArray_AS_STRING(self) + start, end - start,
-            needle, needle, mode);
+            needle, needle, FAST_SEARCH);
         if (res >= 0)
             res += start;
     }
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -1806,10 +1806,9 @@
     /* Issue #23573: FIXME, windows has no memrchr() */
     else if (sub_len == 1 && dir > 0) {
         unsigned char needle = *sub;
-        int mode = (dir > 0) ? FAST_SEARCH : FAST_RSEARCH;
         res = stringlib_fastsearch_memchr_1char(
             PyBytes_AS_STRING(self) + start, end - start,
-            needle, needle, mode);
+            needle, needle, FAST_SEARCH);
         if (res >= 0)
             res += start;
     }

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list