From 54579c50b49e4c927fe573fd97a65967157ac65b Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Mon, 23 Oct 2017 13:21:59 +0200 Subject: [PATCH] [SMPI] Move variable declaration into for-loop --- src/smpi/internals/smpi_global.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 7b6db073de..ed39e4a0df 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -662,9 +662,8 @@ int smpi_main(const char* executable, int argc, char *argv[]) "You may want to use sampling functions or trace replay to reduce this."); } } - int count = smpi_process_count(); int ret = 0; - for (int i = 0; i < count; i++) { + for (int i = 0, count = smpi_process_count(); i < count; i++) { if(process_data[i]->return_value()!=0){ ret=process_data[i]->return_value();//return first non 0 value break; -- 2.20.1