keepalive: remove limit argument from readline()
authorGregory Szorc <gregory.szorc@gmail.com>
Wed, 07 Oct 2015 15:53:58 -0700
changeset 30687 5d06f6b73a57
parent 30686 8352c42a0a0d
child 30688 dc5b594f41e9
keepalive: remove limit argument from readline() It is unused and adds complexity.
mercurial/keepalive.py
--- a/mercurial/keepalive.py	Wed Oct 07 15:33:52 2015 -0700
+++ b/mercurial/keepalive.py	Wed Oct 07 15:53:58 2015 -0700
@@ -451,9 +451,9 @@
 
         return ''.join(parts)
 
-    def readline(self, limit=-1):
+    def readline(self):
         i = self._rbuf.find('\n')
-        while i < 0 and not (0 < limit <= len(self._rbuf)):
+        while i < 0:
             new = self._raw_read(self._rbufsize)
             if not new:
                 break
@@ -465,8 +465,6 @@
             i = len(self._rbuf)
         else:
             i = i + 1
-        if 0 <= limit < len(self._rbuf):
-            i = limit
         data, self._rbuf = self._rbuf[:i], self._rbuf[i:]
         return data