Modernize: Use range-based for loops for readability (#762)

Also run clang-format on these files as requested
This commit is contained in:
Andy Maloney
2019-10-05 15:20:17 -04:00
committed by Jesse Beder
parent 21d75fa4cd
commit b650bc8287
7 changed files with 37 additions and 37 deletions

View File

@@ -12,8 +12,7 @@ namespace YAML {
namespace Exp {
unsigned ParseHex(const std::string& str, const Mark& mark) {
unsigned value = 0;
for (std::size_t i = 0; i < str.size(); i++) {
char ch = str[i];
for (char ch : str) {
int digit = 0;
if ('a' <= ch && ch <= 'f')
digit = ch - 'a' + 10;
@@ -132,5 +131,5 @@ std::string Escape(Stream& in) {
std::stringstream msg;
throw ParserException(in.mark(), std::string(ErrorMsg::INVALID_ESCAPE) + ch);
}
}
}
} // namespace Exp
} // namespace YAML