]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
removed unnecessary else statements 976/head
authordaftshady <daftonshady@gmail.com>
Mon, 20 Jan 2014 13:33:38 +0000 (22:33 +0900)
committerdaftshady <daftonshady@gmail.com>
Mon, 20 Jan 2014 13:33:38 +0000 (22:33 +0900)
tornado/iostream.py

index 197230f33f714c97debec208386aa18a378109d9..1554ddf6950145faf4a0f777e00771331955f50c 100644 (file)
@@ -219,11 +219,8 @@ class BaseIOStream(object):
             # write buffer, so we don't have to recopy the entire thing
             # as we slice off pieces to send to the socket.
             WRITE_BUFFER_CHUNK_SIZE = 128 * 1024
-            if len(data) > WRITE_BUFFER_CHUNK_SIZE:
-                for i in range(0, len(data), WRITE_BUFFER_CHUNK_SIZE):
-                    self._write_buffer.append(data[i:i + WRITE_BUFFER_CHUNK_SIZE])
-            else:
-                self._write_buffer.append(data)
+            for i in range(0, len(data), WRITE_BUFFER_CHUNK_SIZE):
+                self._write_buffer.append(data[i:i + WRITE_BUFFER_CHUNK_SIZE])
         self._write_callback = stack_context.wrap(callback)
         if not self._connecting:
             self._handle_write()