mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-15 23:20:05 +02:00
STYLE: Use range-based loops from C++11
C++11 Range based for loops can be used in Used as a more readable equivalent to the traditional for loop operating over a range of values, such as all elements in a container, in the forward direction.. Range based loopes are more explicit for only computing the end location once for containers. SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/ run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-loop-convert -header-filter=.* -fix
This commit is contained in:

committed by
Hans Johnson

parent
3beadff472
commit
cbeed7b076
@@ -110,9 +110,7 @@ static void printValueTree(FILE* fout,
|
||||
Json::Value::Members members(value.getMemberNames());
|
||||
std::sort(members.begin(), members.end());
|
||||
JSONCPP_STRING suffix = *(path.end() - 1) == '.' ? "" : ".";
|
||||
for (Json::Value::Members::iterator it = members.begin();
|
||||
it != members.end(); ++it) {
|
||||
const JSONCPP_STRING name = *it;
|
||||
for (auto name : members) {
|
||||
printValueTree(fout, value[name], path + suffix + name);
|
||||
}
|
||||
} break;
|
||||
|
Reference in New Issue
Block a user