py/objarray: Implement "in" operator for bytearray.

This commit is contained in:
Paul Sokolovsky
2016-02-14 18:55:16 +02:00
parent 609a9c6b71
commit c38809e26b
3 changed files with 26 additions and 1 deletions

View File

@@ -245,7 +245,7 @@ wrong_args:
// like strstr but with specified length and allows \0 bytes
// TODO replace with something more efficient/standard
STATIC const byte *find_subbytes(const byte *haystack, mp_uint_t hlen, const byte *needle, mp_uint_t nlen, mp_int_t direction) {
const byte *find_subbytes(const byte *haystack, mp_uint_t hlen, const byte *needle, mp_uint_t nlen, mp_int_t direction) {
if (hlen >= nlen) {
mp_uint_t str_index, str_index_end;
if (direction > 0) {