From cf5ee65604cb804c36b08900ea7ab2f1cbbd83a4 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 9 Dec 2017 00:15:10 +0100 Subject: [PATCH] Vectorize loop. --- server/TracyView.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index a92e0c08..ad2e0280 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -3231,12 +3231,13 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover ) { auto tmp = it; ++tmp; - while( tmp != end ) + const auto sz = end - tmp; + for( size_t i=0; ival < min ) min = tmp->val; - else if( tmp->val > max ) max = tmp->val; - ++tmp; + min = tmp[i].val < min ? tmp[i].val : min; + max = tmp[i].val > max ? tmp[i].val : max; } + tmp += sz; } const auto revrange = 1.0 / ( max - min );