Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the cache for FunctionTableModel #1023

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions angrmanagement/ui/widgets/qfunction_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def __init__(self, workspace: Workspace, instance: Instance, func_list) -> None:
self.workspace = workspace
self.instance = instance
self._config = Conf
self._data_cache = {}

def __len__(self) -> int:
if self._func_list is not None:
Expand All @@ -76,7 +75,6 @@ def func_list(self) -> list[Function]:
def func_list(self, v) -> None:
self._func_list = None
self._raw_func_list = v
self._data_cache.clear()
self.emit(SIGNAL("layoutChanged()"))

def filter(self, keyword) -> None:
Expand All @@ -91,7 +89,6 @@ def filter(self, keyword) -> None:
if self._func_match_keyword(func, keyword, extra_columns=extra_columns)
]

self._data_cache.clear()
self.emit(SIGNAL("layoutChanged()"))

def rowCount(self, *args, **kwargs): # pylint:disable=unused-argument
Expand Down Expand Up @@ -124,16 +121,6 @@ def data(self, index, role):
return None

col = index.column()

key = (row, col, role)
if key in self._data_cache:
value = self._data_cache[key]
else:
value = self._data_uncached(row, col, role)
self._data_cache[key] = value
return value

def _data_uncached(self, row, col, role):
func = self.func_list[row]

if role == Qt.DisplayRole:
Expand Down
Loading