[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 2b363ac 1/2: Modernize a for statement
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 2b363ac 1/2: Modernize a for statement |
Date: |
Tue, 17 Jan 2017 01:36:38 +0000 (UTC) |
branch: master
commit 2b363ac9be022a4be466e38dc0525c001a551aea
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Modernize a for statement
See:
http://lists.nongnu.org/archive/html/lmi/2017-01/msg00091.html
---
wx_test_paste_census.cpp | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/wx_test_paste_census.cpp b/wx_test_paste_census.cpp
index 86db9f6..b69c95b 100644
--- a/wx_test_paste_census.cpp
+++ b/wx_test_paste_census.cpp
@@ -93,14 +93,16 @@ std::string build_not_found_message(std::set<std::string>
const& remaining)
bool const only_one = remaining.size() == 1;
message << (only_one ? "column" : "columns");
- for(auto i = remaining.begin(); i != remaining.end(); ++i)
+ bool first = true;
+ for(auto const& i : remaining)
{
- if(i != remaining.begin())
+ if(!first)
{
message << ",";
+ first = false;
}
- message << " '" << *i << "'";
+ message << " '" << i << "'";
}
message << " " << (only_one ? "was" : "were") << " not found" << " ";