[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kcachegrind] /: qSort/qStableSort/qLowerBound -> std::sort/stable_sort/lower_bound
From:       Christian Ehrlicher <Ch.Ehrlicher () gmx ! de>
Date:       2016-11-24 6:18:54
Message-ID: E1c9nN0-0008G5-TZ () code ! kde ! org
[Download RAW message or body]

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 == 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(TraceFunction *f, bool add)
         // find insertion point with current list order
         FunctionLessThan lessThan(_sortColumn, _sortOrder, _eventType);
         QList<TraceFunction*>::iterator insertPos;
-        insertPos = qLowerBound(_topList.begin(), _topList.end(),
-                                f, lessThan);
+        insertPos = std::lower_bound(_topList.begin(), _topList.end(),
+                                     f, lessThan);
         row = 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 == 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 = _lowList.begin(); // iterators to list start
     _highListIter = _highList.begin();
     _arrowLevels = 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 = nextIt;
         if (it == 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 = _lowList.begin(); // iterators to list start
     _highListIter = _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) != -1)
-        qSort(_children->begin(), _children->end(), treeMapItemLessThan);
+        std::sort(_children->begin(), _children->end(), treeMapItemLessThan);
 }
 
 
@@ -1077,7 +1077,7 @@ void TreeMapItem::setSorting(int textNo, bool ascending)
     _sortTextNo = textNo;
 
     if (_children && _sortTextNo != -1)
-        qSort(_children->begin(), _children->end(), treeMapItemLessThan);
+        std::sort(_children->begin(), _children->end(), treeMapItemLessThan);
 }
 
 void TreeMapItem::resort(bool recursive)
@@ -1085,7 +1085,7 @@ void TreeMapItem::resort(bool recursive)
     if (!_children) return;
 
     if (_sortTextNo != -1)
-        qSort(_children->begin(), _children->end(), treeMapItemLessThan);
+        std::sort(_children->begin(), _children->end(), treeMapItemLessThan);
 
     if (recursive)
         foreach(TreeMapItem* i, *_children)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic