Do not query the row count repeatedly.

The compiler is not smart enough to hoist this call out
of the loop. But we can expect that the row count will not
change during a call to filterAcceptsRow.
wilder
Milian Wolff 11 years ago
parent 7eeac78170
commit 704fdba37b
  1. 2
      src/krecursivefilterproxymodel.cpp

@ -301,7 +301,7 @@ bool KRecursiveFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelInd
Q_ASSERT(source_index.isValid());
bool accepted = false;
for (int row = 0; row < sourceModel()->rowCount(source_index); ++row) {
for (int row = 0, rows = sourceModel()->rowCount(source_index); row < rows; ++row) {
if (filterAcceptsRow(row, source_index)) {
accepted = true;
break;

Loading…
Cancel
Save