From 7b848b8c5f0ae43f3b7e4cc9ebacededfa517a2c Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 16 Sep 2018 08:58:56 +1000 Subject: Backport: Moved declaration to avoid warnings from linters. Backport of changeset 7087:e408638433a4. --- 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 df3f0d5f5..e038e5203 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -2983,7 +2983,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. @@ -2997,9 +2996,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