From abd03fbbc68824fe2d38cd0d62ba3b99ecd89463 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Wed, 13 Mar 2019 11:21:47 -0400 Subject: Improve initialization performance of StructuredDataView, add struct length --- python/binaryview.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'python') 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 "".format(self._structure_name, self._structure.width, self._address) + + def __len__(self): + return self._structure.width -- cgit v1.3.1