Skip to content
Browse files

Substitute method call by its operation

  • Loading branch information...
1 parent b776703 commit adccc649e0b296ac8c192cee51f13cea096c923d @pietern pietern committed Mar 13, 2012
Showing with 2 additions and 6 deletions.
  1. +2 −6 lib/redis/connection/ruby.rb
View
8 lib/redis/connection/ruby.rb
@@ -25,7 +25,7 @@ def timeout=(timeout)
end
def read(nbytes)
- result = _read_from_buffer(nbytes)
+ result = @buffer.slice!(0, nbytes)
while result.bytesize < nbytes
result << _read_from_socket(nbytes - result.bytesize)
@@ -43,11 +43,7 @@ def gets
@buffer << _read_from_socket(16384)
end
- _read_from_buffer(crlf + 2)
- end
-
- def _read_from_buffer(nbytes)
- @buffer.slice!(0, nbytes)
+ @buffer.slice!(0, crlf + CRLF.bytesize)
end
def _read_from_socket(nbytes)

0 comments on commit adccc64

Please sign in to comment.
Something went wrong with that request. Please try again.