From 326cf0f77fcfbb3994b0b070e8c55546da5fd187 Mon Sep 17 00:00:00 2001 From: RumovZ Date: Tue, 28 Sep 2021 12:11:20 +0200 Subject: [PATCH] Remove redundant call to `len_columns()` --- qt/aqt/browser/table/table.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/qt/aqt/browser/table/table.py b/qt/aqt/browser/table/table.py index 65981c87e..8bd6ea1ac 100644 --- a/qt/aqt/browser/table/table.py +++ b/qt/aqt/browser/table/table.py @@ -384,10 +384,9 @@ class Table: if KeyboardModifiersPressed().shift or KeyboardModifiersPressed().control: # Current selection is modified. The number of added/removed rows is # usually smaller than the number of rows in the resulting selection. - self._len_selection += len(selected.indexes()) // self._model.len_columns() - self._len_selection -= ( - len(deselected.indexes()) // self._model.len_columns() - ) + self._len_selection += ( + len(selected.indexes()) - len(deselected.indexes()) + ) // self._model.len_columns() else: # New selection is created. Usually a single row or none at all. self._len_selection = len(self._view.selectionModel().selectedRows())