TransRead: remove useless check
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Tue, 28 Jan 2014 11:15:09 +0000 (13:15 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Tue, 28 Jan 2014 12:23:22 +0000 (14:23 +0200)
The _CompressedFile class is designed to work with compressed files, and it
makes no sense to use it for uncompress files. So let's assume that the
decompression function is always present and remove the useless
"if self._decompress_func" check.

Change-Id: Ie427f1507801525f29efd103dfd4cfdf76291b7e
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmaptools/TransRead.py

index c620e5039b1a653e04cf33572f99409380c3bc23..a2730e2bd49455104146e17bcbcde043b90eaa80 100644 (file)
@@ -164,10 +164,9 @@ class _CompressedFile(object):
                 self._eof = True
                 break
 
-            if self._decompress_func:
-                buf = self._decompress_func(buf)
-                if not buf:
-                    continue
+            buf = self._decompress_func(buf)
+            if not buf:
+                continue
 
             assert len(self._buffer) == 0
             assert self._buffer_pos == 0