about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFlorent Monjalet <florent.monjalet@gmail.com>2015-12-04 18:17:08 +0100
committerFlorent Monjalet <florent.monjalet@gmail.com>2016-01-18 14:02:32 +0100
commit7bc3464177860401ae166387cb8327b5ddc08615 (patch)
tree10938f413b1973424fc1cfd05d6d8320874c599f
parent43053bc9556c0f73a7eafe94dd62011ae375183f (diff)
downloadmiasm-7bc3464177860401ae166387cb8327b5ddc08615.tar.gz
miasm-7bc3464177860401ae166387cb8327b5ddc08615.zip
Types: zip -> itertools.izip
-rw-r--r--miasm2/core/types.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/miasm2/core/types.py b/miasm2/core/types.py
index 110321ac..4391734d 100644
--- a/miasm2/core/types.py
+++ b/miasm2/core/types.py
@@ -102,6 +102,7 @@ Note that some structures (e.g. MemStr or MemArray) do not have a static
 size and cannot be allocated automatically.
 """
 
+import itertools
 import logging
 import struct
 
@@ -677,8 +678,8 @@ class Array(Type):
             idx = self._normalize_slice(idx)
             if len(item) != len(xrange(idx.start, idx.stop, idx.step)):
                 raise ValueError("Mismatched lengths in slice assignment")
-            # TODO: izip
-            for i, val in zip(xrange(idx.start, idx.stop, idx.step), item):
+            for i, val in itertools.izip(xrange(idx.start, idx.stop, idx.step),
+                                         item):
                 self.field_type.set(vm, addr + self.get_offset(i), val)
         else:
             idx = self._normalize_idx(idx)