diff -r d6c91b8242d2 Objects/bytearrayobject.c --- a/Objects/bytearrayobject.c Fri Jul 17 16:49:24 2015 -0700 +++ b/Objects/bytearrayobject.c Sat Jul 18 17:34:09 2015 +0300 @@ -1171,12 +1171,16 @@ bytearray_find_internal(PyByteArrayObjec ADJUST_INDICES(start, end, len); if (end - start < sub_len) res = -1; - /* Issue #23573: FIXME, windows has no memrchr() */ - else if (sub_len == 1 && dir > 0) { + else if (sub_len == 1 +#ifndef HAVE_MEMRCHR + && dir > 0 +#endif + ) { 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, FAST_SEARCH); + needle, needle, mode); if (res >= 0) res += start; } diff -r d6c91b8242d2 Objects/bytesobject.c --- a/Objects/bytesobject.c Fri Jul 17 16:49:24 2015 -0700 +++ b/Objects/bytesobject.c Sat Jul 18 17:34:09 2015 +0300 @@ -1815,12 +1815,16 @@ bytes_find_internal(PyBytesObject *self, ADJUST_INDICES(start, end, len); if (end - start < sub_len) res = -1; - /* Issue #23573: FIXME, windows has no memrchr() */ - else if (sub_len == 1 && dir > 0) { + else if (sub_len == 1 +#ifndef HAVE_MEMRCHR + && dir > 0 +#endif + ) { 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, FAST_SEARCH); + needle, needle, mode); if (res >= 0) res += start; }