From cfb11ff8c12079d0cc9ba8e3cbabe29528843bac Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 21 Jun 2020 13:57:37 +0200 Subject: [PATCH] Check if plot data contains the earliest timestamp of the whole profile --- import-chrome/src/import-chrome.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/import-chrome/src/import-chrome.cpp b/import-chrome/src/import-chrome.cpp index 4fb353cc..9809cfd3 100644 --- a/import-chrome/src/import-chrome.cpp +++ b/import-chrome/src/import-chrome.cpp @@ -171,11 +171,16 @@ int main( int argc, char** argv ) { if( mts > messages[0].timestamp ) mts = messages[0].timestamp; } + for( auto& plot : plots ) + { + if( mts > plot.data[0].first ) mts = plot.data[0].first; + } for( auto& v : timeline ) v.timestamp -= mts; for( auto& v : messages ) v.timestamp -= mts; for( auto& plot : plots ) - for( auto& v : plot.data ) - v.first -= mts; + { + for( auto& v : plot.data ) v.first -= mts; + } printf( "\33[2KProcessing...\r" ); fflush( stdout );