Use const auto& in for loops.

Change-Id: Ic437c59797ee4e7dc38291da35c72d827bc89c8d
This commit is contained in:
Elliott Hughes
2015-10-02 18:25:19 -07:00
parent f7cf8b2c1f
commit 0b2acdfcc9
3 changed files with 10 additions and 11 deletions

View File

@@ -635,7 +635,7 @@ static void HandleSignals(std::vector<TestCase>& testcase_list,
sigquit_flag = false;
// Print current running tests.
printf("List of current running tests:\n");
for (auto& child_proc : child_proc_list) {
for (const auto& child_proc : child_proc_list) {
if (child_proc.pid != 0) {
std::string test_name = testcase_list[child_proc.testcase_id].GetTestName(child_proc.test_id);
int64_t current_time_ns = NanoTime();
@@ -646,7 +646,7 @@ static void HandleSignals(std::vector<TestCase>& testcase_list,
} else if (sigint_flag) {
sigint_flag = false;
// Kill current running tests.
for (auto& child_proc : child_proc_list) {
for (const auto& child_proc : child_proc_list) {
if (child_proc.pid != 0) {
// Send SIGKILL to ensure the child process can be killed unconditionally.
kill(child_proc.pid, SIGKILL);