From kde-commits Thu Nov 24 06:18:54 2016 From: Christian Ehrlicher Date: Thu, 24 Nov 2016 06:18:54 +0000 To: kde-commits Subject: [kcachegrind] /: qSort/qStableSort/qLowerBound -> std::sort/stable_sort/lower_bound Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=147996834423284 Git commit 3306cb3eb00633ffbe1e4b44e233f43753458bb5 by Christian Ehrlicher. Committed on 24/11/2016 at 06:18. Pushed by chehrlic into branch 'master'. qSort/qStableSort/qLowerBound -> std::sort/stable_sort/lower_bound REVIEW: 129535 M +1 -1 libcore/tracedata.cpp M +2 -2 libviews/callgraphview.cpp M +4 -4 libviews/functionlistmodel.cpp M +2 -2 libviews/instrview.cpp M +2 -2 libviews/sourceview.cpp M +3 -3 libviews/treemap.cpp https://commits.kde.org/kcachegrind/3306cb3eb00633ffbe1e4b44e233f43753458bb5 diff --git a/libcore/tracedata.cpp b/libcore/tracedata.cpp index 61270ea..7d351b6 100644 --- a/libcore/tracedata.cpp +++ b/libcore/tracedata.cpp @@ -3163,7 +3163,7 @@ int TraceData::load(QStringList files) } if (partsLoaded =3D=3D 0) return 0; = - qSort(_parts.begin(), _parts.end(), partLessThan); + std::sort(_parts.begin(), _parts.end(), partLessThan); invalidateDynamicCost(); updateFunctionCycles(); = diff --git a/libviews/callgraphview.cpp b/libviews/callgraphview.cpp index 1df0609..674d067 100644 --- a/libviews/callgraphview.cpp +++ b/libviews/callgraphview.cpp @@ -152,8 +152,8 @@ CalleeGraphEdgeLessThan calleeGraphEdgeLessThan; = void GraphNode::sortEdges() { - qSort(callers.begin(), callers.end(), callerGraphEdgeLessThan); - qSort(callees.begin(), callees.end(), calleeGraphEdgeLessThan); + std::sort(callers.begin(), callers.end(), callerGraphEdgeLessThan); + std::sort(callees.begin(), callees.end(), calleeGraphEdgeLessThan); } = void GraphNode::addCallee(GraphEdge* e) diff --git a/libviews/functionlistmodel.cpp b/libviews/functionlistmodel.cpp index 16cd15f..32353fc 100644 --- a/libviews/functionlistmodel.cpp +++ b/libviews/functionlistmodel.cpp @@ -159,8 +159,8 @@ QModelIndex FunctionListModel::indexForFunction(TraceFu= nction *f, bool add) // find insertion point with current list order FunctionLessThan lessThan(_sortColumn, _sortOrder, _eventType); QList::iterator insertPos; - insertPos =3D qLowerBound(_topList.begin(), _topList.end(), - f, lessThan); + insertPos =3D std::lower_bound(_topList.begin(), _topList.end(), + f, lessThan); row =3D insertPos - _topList.begin(); beginInsertRows(QModelIndex(), row, row); _topList.insert(row, f); @@ -310,7 +310,7 @@ void FunctionListModel::computeTopList() } = FunctionLessThan lessThan(_sortColumn, _sortOrder, _eventType); - qStableSort(_filteredList.begin(), _filteredList.end(), lessThan); + std::stable_sort(_filteredList.begin(), _filteredList.end(), lessThan); = foreach(TraceFunction* f, _filteredList) { _topList.append(f); @@ -322,7 +322,7 @@ void FunctionListModel::computeTopList() if (_max0 && !_topList.contains(_max0)) maxList.append(_max0); if (_max1 && !_topList.contains(_max1)) maxList.append(_max1); if (_max2 && !_topList.contains(_max2)) maxList.append(_max2); - qSort(maxList.begin(), maxList.end(), lessThan); + std::stable_sort(maxList.begin(), maxList.end(), lessThan); _topList.append(maxList); = endResetModel(); diff --git a/libviews/instrview.cpp b/libviews/instrview.cpp index d50f88d..6031d3e 100644 --- a/libviews/instrview.cpp +++ b/libviews/instrview.cpp @@ -603,8 +603,8 @@ void InstrView::refresh() } if (it =3D=3D itEnd) break; } - qSort(_lowList.begin(), _lowList.end(), instrJumpLowLessThan); - qSort(_highList.begin(), _highList.end(), instrJumpHighLessThan); + std::sort(_lowList.begin(), _lowList.end(), instrJumpLowLessThan); + std::sort(_highList.begin(), _highList.end(), instrJumpHighLessThan); _lowListIter =3D _lowList.begin(); // iterators to list start _highListIter =3D _highList.begin(); _arrowLevels =3D 0; diff --git a/libviews/sourceview.cpp b/libviews/sourceview.cpp index cafede9..3fdd06e 100644 --- a/libviews/sourceview.cpp +++ b/libviews/sourceview.cpp @@ -726,8 +726,8 @@ void SourceView::fillSourceFile(TraceFunctionSource* sf= , int fileno) it =3D nextIt; if (it =3D=3D lineItEnd) break; } - qSort(_lowList.begin(), _lowList.end(), lineJumpLowLessThan); - qSort(_highList.begin(), _highList.end(), lineJumpHighLessThan); + std::sort(_lowList.begin(), _lowList.end(), lineJumpLowLessThan); + std::sort(_highList.begin(), _highList.end(), lineJumpHighLessThan); _lowListIter =3D _lowList.begin(); // iterators to list start _highListIter =3D _highList.begin(); _jump.resize(0); diff --git a/libviews/treemap.cpp b/libviews/treemap.cpp index f858fb3..af2aeb6 100644 --- a/libviews/treemap.cpp +++ b/libviews/treemap.cpp @@ -1010,7 +1010,7 @@ void TreeMapItem::addItem(TreeMapItem* i) = _children->append(i); // preserve insertion order if (sorting(0) !=3D -1) - qSort(_children->begin(), _children->end(), treeMapItemLessThan); + std::sort(_children->begin(), _children->end(), treeMapItemLessTha= n); } = = @@ -1077,7 +1077,7 @@ void TreeMapItem::setSorting(int textNo, bool ascendi= ng) _sortTextNo =3D textNo; = if (_children && _sortTextNo !=3D -1) - qSort(_children->begin(), _children->end(), treeMapItemLessThan); + std::sort(_children->begin(), _children->end(), treeMapItemLessTha= n); } = void TreeMapItem::resort(bool recursive) @@ -1085,7 +1085,7 @@ void TreeMapItem::resort(bool recursive) if (!_children) return; = if (_sortTextNo !=3D -1) - qSort(_children->begin(), _children->end(), treeMapItemLessThan); + std::sort(_children->begin(), _children->end(), treeMapItemLessTha= n); = if (recursive) foreach(TreeMapItem* i, *_children)