Skip to content
Permalink
Browse files

Microoptimise and avoid cache lookup when no sort order set

  • Loading branch information
nyalldawson committed May 23, 2017
1 parent 80a000c commit ebee1019691ad67132d5c3736dc9826739b3e583
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/gui/attributetable/qgsattributetablefiltermodel.cpp
@@ -58,6 +58,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 ebee101

Please sign in to comment.
You can’t perform that action at this time.