[bmap-tools] [PATCH 4/9] TransRead: remove useless check

Artem Bityutskiy dedekind1 at gmail.com
Tue Jan 28 08:45:56 EST 2014


From: Artem Bityutskiy <artem.bityutskiy at intel.com>

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 at intel.com>
---
 bmaptools/TransRead.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/bmaptools/TransRead.py b/bmaptools/TransRead.py
index c620e50..a2730e2 100644
--- a/bmaptools/TransRead.py
+++ b/bmaptools/TransRead.py
@@ -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
-- 
1.8.3.1




More information about the Bmap-tools mailing list