From baf66856184415d3d4623e11bb05f03d7245b245 Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Sun, 20 Mar 2022 19:13:50 +0800 Subject: [PATCH] optimize: qGreater was obsolete use std::less instead --- favoritespanewidget.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/favoritespanewidget.cc b/favoritespanewidget.cc index bb8cf343..c5e4847e 100644 --- a/favoritespanewidget.cc +++ b/favoritespanewidget.cc @@ -907,9 +907,8 @@ void FavoritesModel::removeItemsForIndexes( const QModelIndexList & idxList ) for( int i = lowestLevel; i >= 0; i-- ) { QModelIndexList idxSublist = itemsToDelete[ i ]; - //std::greater does not work ,operator < not implemented ,use std:less first ,then std::reverse. - std::sort(idxSublist.begin(), idxSublist.end(), std::less()); - std::reverse(idxSublist.begin(), idxSublist.end()); + // std::greater does not work as operator < not implemented + std::sort( idxSublist.begin(), idxSublist.end(), std::not2( std::less< QModelIndex >() ) ); it = idxSublist.begin(); for( ; it != idxSublist.end(); ++it )