diff --git a/src/View/Pollutants/Table.py b/src/View/Pollutants/Table.py index df450095..24d4bc5b 100644 --- a/src/View/Pollutants/Table.py +++ b/src/View/Pollutants/Table.py @@ -110,14 +110,10 @@ class TableModel(PamhyrTableModel): def delete(self, rows, parent=QModelIndex()): self.beginRemoveRows(parent, rows[0], rows[-1]) - data_rows = { - id(pol): i for i, pol in enumerate(self._data._Pollutants._lst) - } self._undo.push( DelCommand( self._data._Pollutants, - [data_rows[id(self._lst[row])] for row in rows - if 0 <= row < len(self._lst)], + [row for row in rows if 0 <= row < len(self._lst)], self._data.ic_adists ) )