A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[sonar] Change raw for-loops to range for-loops.
[simgrid.git]
/
teshsuite
/
xbt
/
parallel_log_crashtest
/
parallel_log_crashtest.cpp
diff --git
a/teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest.cpp
b/teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest.cpp
index
b894023
..
1ea8857
100644
(file)
--- a/
teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest.cpp
+++ b/
teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest.cpp
@@
-34,13
+34,13
@@
int main(int argc, char* argv[])
std::thread crashers[crasher_amount];
/* spawn threads */
std::thread crashers[crasher_amount];
/* spawn threads */
- for (int i = 0; i < crasher_amount; i++) {
- crashers[i] = std::thread(crasher_thread, i);
- }
+ int id = 0;
+ for (std::thread& thr : crashers)
+ thr = std::thread(crasher_thread, id++);
/* wait for them */
/* wait for them */
- for (
int i = 0; i < crasher_amount; i++
)
-
crashers[i]
.join();
+ for (
std::thread& thr : crashers
)
+
thr
.join();
return 0;
}
return 0;
}