diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2015-09-28 15:34:29 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2015-09-28 15:34:29 -0700 |
commit | ed2a079cc3ff7db82e197307d388ca9c96cb092e (patch) | |
tree | 2fec24357bdcf1558feb0fcfd0a0beded958d6a3 /redis/connection.py | |
parent | f6338499b2d390dcb25c8835f9418f63794be2a5 (diff) | |
download | redis-py-ed2a079cc3ff7db82e197307d388ca9c96cb092e.tar.gz |
removed the proactive check in HiredisParser for a line ending
it turns out just calling into hiredis to test this is faster than
doing string compare in Python. fixes #615 and #650.
Diffstat (limited to 'redis/connection.py')
-rwxr-xr-x | redis/connection.py | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/redis/connection.py b/redis/connection.py index 0229d28..19d6925 100755 --- a/redis/connection.py +++ b/redis/connection.py @@ -346,15 +346,6 @@ class HiredisParser(BaseParser): self._reader.feed(self._buffer, 0, bufflen) else: self._reader.feed(buffer) - # proactively, but not conclusively, check if more data is in the - # buffer. if the data received doesn't end with \r\n, there's more. - if HIREDIS_USE_BYTE_BUFFER: - if bufflen > 2 and \ - self._buffer[bufflen - 2:bufflen] != SYM_CRLF: - continue - else: - if not buffer.endswith(SYM_CRLF): - continue response = self._reader.gets() # if an older version of hiredis is installed, we need to attempt # to convert ResponseErrors to their appropriate types. |