mirror of
https://github.com/ankitects/anki.git
synced 2025-12-10 21:36:55 -05:00
Remove redundant call to len_columns()
This commit is contained in:
parent
72f6f9a47a
commit
326cf0f77f
1 changed files with 3 additions and 4 deletions
|
|
@ -384,10 +384,9 @@ class Table:
|
||||||
if KeyboardModifiersPressed().shift or KeyboardModifiersPressed().control:
|
if KeyboardModifiersPressed().shift or KeyboardModifiersPressed().control:
|
||||||
# Current selection is modified. The number of added/removed rows is
|
# Current selection is modified. The number of added/removed rows is
|
||||||
# usually smaller than the number of rows in the resulting selection.
|
# usually smaller than the number of rows in the resulting selection.
|
||||||
self._len_selection += len(selected.indexes()) // self._model.len_columns()
|
self._len_selection += (
|
||||||
self._len_selection -= (
|
len(selected.indexes()) - len(deselected.indexes())
|
||||||
len(deselected.indexes()) // self._model.len_columns()
|
) // self._model.len_columns()
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
# New selection is created. Usually a single row or none at all.
|
# New selection is created. Usually a single row or none at all.
|
||||||
self._len_selection = len(self._view.selectionModel().selectedRows())
|
self._len_selection = len(self._view.selectionModel().selectedRows())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue