From f00ec0861b9ed5a4fc80be2a1832274da3c12ff9 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 16 Sep 2018 08:58:56 +1000 Subject: Moved declaration to avoid warnings from linters. --- src/Document.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Document.cxx b/src/Document.cxx index 3d5ae2d49..04efe2e32 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -2980,7 +2980,6 @@ std::regex_constants::match_flag_type MatchFlags(const Document *doc, Sci::Posit template bool MatchOnLines(const Document *doc, const Regex ®exp, const RESearchRange &resr, RESearch &search) { - bool matched = false; std::match_results match; // MSVC and libc++ have problems with ^ and $ matching line ends inside a range. @@ -2994,9 +2993,10 @@ bool MatchOnLines(const Document *doc, const Regex ®exp, const RESearchRange Iterator itStart(doc, resr.startPos); Iterator itEnd(doc, resr.endPos); const std::regex_constants::match_flag_type flagsMatch = MatchFlags(doc, resr.startPos, resr.endPos); - matched = std::regex_search(itStart, itEnd, match, regexp, flagsMatch); + const bool matched = std::regex_search(itStart, itEnd, match, regexp, flagsMatch); #else // Line by line. + bool matched = false; for (Sci::Line line = resr.lineRangeStart; line != resr.lineRangeBreak; line += resr.increment) { const Range lineRange = resr.LineRange(line); Iterator itStart(doc, lineRange.start); -- cgit v1.2.3