From 7b194d2349b612b8261a75aba77bd767eb2a8051 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 2 Apr 2018 16:09:44 +0200 Subject: [PATCH] Don't use std::sort. --- server/TracyView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 395041fb..d69ce948 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -2511,7 +2511,7 @@ void View::DrawZoneInfoWindow() cti[i] = uint32_t( i ); } - std::sort( cti.get(), cti.get() + ev.child.size(), [&ctt] ( const auto& lhs, const auto& rhs ) { return ctt[lhs] > ctt[rhs]; } ); + pdqsort_branchless( cti.get(), cti.get() + ev.child.size(), [&ctt] ( const auto& lhs, const auto& rhs ) { return ctt[lhs] > ctt[rhs]; } ); if( !ev.child.empty() ) { @@ -2670,7 +2670,7 @@ void View::DrawGpuInfoWindow() cti[i] = uint32_t( i ); } - std::sort( cti.get(), cti.get() + ev.child.size(), [&ctt] ( const auto& lhs, const auto& rhs ) { return ctt[lhs] > ctt[rhs]; } ); + pdqsort_branchless( cti.get(), cti.get() + ev.child.size(), [&ctt] ( const auto& lhs, const auto& rhs ) { return ctt[lhs] > ctt[rhs]; } ); if( !ev.child.empty() ) { @@ -3484,7 +3484,7 @@ void View::DrawFindZone() } if( m_findZone.sortByCounts ) { - std::sort( threads.begin(), threads.end(), []( const auto& lhs, const auto& rhs ) { return lhs->second.size() > rhs->second.size(); } ); + pdqsort_branchless( threads.begin(), threads.end(), []( const auto& lhs, const auto& rhs ) { return lhs->second.size() > rhs->second.size(); } ); } ImGui::BeginChild( "##zonesScroll", ImVec2( ImGui::GetWindowContentRegionWidth(), std::max( 200.f, ImGui::GetContentRegionAvail().y ) ) ); @@ -3911,7 +3911,7 @@ void View::DrawMemory() { items.emplace_back( v.second ); } - std::sort( items.begin(), items.end(), []( const auto& lhs, const auto& rhs ) { return lhs->timeAlloc < rhs->timeAlloc; } ); + pdqsort_branchless( items.begin(), items.end(), []( const auto& lhs, const auto& rhs ) { return lhs->timeAlloc < rhs->timeAlloc; } ); } ImGui::SameLine();