Skip to content
Permalink
Browse files
Microoptimise and avoid cache lookup when no sort order set
(cherry-picked from ebee101)
  • Loading branch information
nyalldawson committed May 23, 2017
1 parent 4acc480 commit 8992eeaeef52cc8eb63b2548081680a98557f865
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/gui/attributetable/qgsattributetablefiltermodel.cpp
@@ -57,6 +57,12 @@ bool QgsAttributeTableFilterModel::lessThan( const QModelIndex &left, const QMod
}
}

if ( mTableModel->sortCacheExpression().isEmpty() )
{
//shortcut when no sort order set
return false;
}

return qgsVariantLessThan( left.data( QgsAttributeTableModel::SortRole ),
right.data( QgsAttributeTableModel::SortRole ) );
}

0 comments on commit 8992eea

Please sign in to comment.