diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-12-04 22:39:07 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-12-04 22:39:07 +0000 |
commit | 62d9c8ea87dbd34eeaad211586015d879636eb0b (patch) | |
tree | 3a3f9aa166ec2bd8002fd2a20de237961ef69566 | |
parent | a12bf1bb1e5b39f2b416f049c5503fa305f6f65a (diff) | |
download | mogilefs-client-62d9c8ea87dbd34eeaad211586015d879636eb0b.tar.gz |
Minor cleanup, one less un-optimized method dispatch.
-rw-r--r-- | lib/mogilefs/socket_common.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mogilefs/socket_common.rb b/lib/mogilefs/socket_common.rb index 298e3da..404acd0 100644 --- a/lib/mogilefs/socket_common.rb +++ b/lib/mogilefs/socket_common.rb @@ -43,9 +43,9 @@ module MogileFS::SocketCommon def read(size, buf = "", timeout = 5) timed_read(size, buf, timeout) or return # nil/EOF - while size > buf.bytesize + while (size -= buf.bytesize) > 0 tmp ||= "" - timed_read(size - buf.bytesize, tmp, timeout) or return buf # truncated + timed_read(size, tmp, timeout) or return buf # truncated buf << tmp end |