From ce0966b9b7f11f8f6a899fc0bdf570ce6dd83b16 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Fri, 23 Oct 2020 13:13:47 +0100 Subject: [PATCH] Improve validate implementation --- components/fallback/validate.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/fallback/validate.cpp b/components/fallback/validate.cpp index 24865a0398..27f1f233e5 100644 --- a/components/fallback/validate.cpp +++ b/components/fallback/validate.cpp @@ -9,11 +9,11 @@ void Fallback::validate(boost::any& v, std::vector const& tokens, F FallbackMap *map = boost::any_cast(&v); - for (std::vector::const_iterator it = tokens.begin(); it != tokens.end(); ++it) + for (const auto& token : tokens) { - std::string temp = Files::EscapeHashString::processString(*it); - int sep = temp.find(","); - if (sep < 1 || sep == (int)temp.length() - 1) + std::string temp = Files::EscapeHashString::processString(token); + size_t sep = temp.find(","); + if (sep < 1 || sep == temp.length() - 1) #if (BOOST_VERSION < 104200) throw boost::program_options::validation_error("invalid value"); #else