From 942fd2bcfd384a12c900999fe663202c87319a68 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 6 Apr 2021 20:06:18 +0100 Subject: Switch simple iterator loops to use range-based for loops. --- include/modules/regex.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/modules/regex.h') diff --git a/include/modules/regex.h b/include/modules/regex.h index 1ae7acd73..549b00918 100644 --- a/include/modules/regex.h +++ b/include/modules/regex.h @@ -193,9 +193,9 @@ inline Regex::PatternPtr Regex::Engine::CreateHuman(const std::string& pattern) throw Exception(pattern, "Regex patterns must be terminated with a '/'!"); uint8_t options = Regex::OPT_NONE; - for (std::string::const_iterator iter = pattern.begin() + end + 1; iter != pattern.end(); ++iter) + for (const auto& flag : insp::iterator_range(pattern.begin() + end + 1, pattern.end())) { - switch (*iter) + switch (flag) { case 'I': case 'i': -- cgit v1.3.1-10-gc9f91