More speed-ups by not constantly rebuilding the native_dictionary list.

This commit is contained in:
Mike Auty
2013-05-07 23:38:03 +01:00
parent e0433ab4e9
commit 72d971bf3f
+3 -1
View File
@@ -16,6 +16,8 @@ class NativeTable(interfaces.symbols.NativeTableInterface):
for native_type in self._native_dictionary.keys():
native_class, _native_struct = self._native_dictionary[native_type]
self._overrides[native_type] = native_class
# Create this once early, because it may get used a lot
self._symbols = set(self._native_dictionary.keys()).union(set(['Enumeration', 'array', 'BitField', 'void', 'pointer']))
def get_symbol_class(self, symbol):
ntype, fmt = native_types.get(symbol, (objects.Integer, ''))
@@ -24,7 +26,7 @@ class NativeTable(interfaces.symbols.NativeTableInterface):
@property
def symbols(self):
"""Returns an iterator of the symbol names"""
return set(self._native_dictionary.keys()).union(set(['Enumeration', 'array', 'BitField', 'void', 'pointer']))
return self._symbols
def resolve(self, symbol_name):
"""Resolves a symbol name into an object template