KRecursiveFilterProxyModel: small optimization, call rowCount() only once

wilder
David Faure 10 years ago
parent 57969ef54a
commit e040853e82
  1. 3
      src/krecursivefilterproxymodel.cpp

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

Loading…
Cancel
Save