1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-03 14:03:52 +00:00

Vectorize loop.

This commit is contained in:
Bartosz Taudul 2017-12-09 00:15:10 +01:00
parent 96cd782011
commit cf5ee65604

View File

@ -3231,12 +3231,13 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover )
{ {
auto tmp = it; auto tmp = it;
++tmp; ++tmp;
while( tmp != end ) const auto sz = end - tmp;
for( size_t i=0; i<sz; i++ )
{ {
if( tmp->val < min ) min = tmp->val; min = tmp[i].val < min ? tmp[i].val : min;
else if( tmp->val > max ) max = tmp->val; max = tmp[i].val > max ? tmp[i].val : max;
++tmp;
} }
tmp += sz;
} }
const auto revrange = 1.0 / ( max - min ); const auto revrange = 1.0 / ( max - min );