summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2019-03-13 11:21:47 -0400
committerRusty Wagner <rusty@vector35.com>2019-03-20 12:58:42 -0400
commitabd03fbbc68824fe2d38cd0d62ba3b99ecd89463 (patch)
tree77ab080653feecb48cedcdc042b8bcdeef5c4210
parent290ce35e6e1091b52e03257fb38b41f1a2c82665 (diff)
Improve initialization performance of StructuredDataView, add struct length
-rw-r--r--python/binaryview.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index e309486f..abf89ca8 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -4652,7 +4652,7 @@ class StructuredDataView(object):
self._define_members()
def _lookup_structure(self):
- s = self._bv.types.get(self._structure_name, None)
+ s = self._bv.get_type_by_name(self._structure_name)
if s is None:
raise Exception("Could not find structure with name: {}".format(self._structure_name))
@@ -4710,3 +4710,6 @@ class StructuredDataView(object):
def __repr__(self):
return "<StructuredDataView type:{} size:{:#x} address:{:#x}>".format(self._structure_name,
self._structure.width, self._address)
+
+ def __len__(self):
+ return self._structure.width