summaryrefslogtreecommitdiff
path: root/src/regex_impl.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-10-03 01:16:30 +0800
committerMaxime Coste <mawww@kakoune.org>2017-11-01 14:05:14 +0800
commit11b9c996ea2791c16fd7ff205e10499bc32afff4 (patch)
tree83fabaf14f5c6746b88d54aed100a953c7d9a103 /src/regex_impl.hh
parent51ad8b4c8545279a6af0a7b87fcd29af4e5735cb (diff)
Regex: small code style tweak
Diffstat (limited to 'src/regex_impl.hh')
-rw-r--r--src/regex_impl.hh10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/regex_impl.hh b/src/regex_impl.hh
index 12f71ac8..8b7fa9b8 100644
--- a/src/regex_impl.hh
+++ b/src/regex_impl.hh
@@ -242,6 +242,8 @@ struct ThreadedRegexVM
if (m_threads.empty())
return found_match;
}
+ if (found_match)
+ return true;
// Step remaining threads to see if they match without consuming anything else
for (int i = 0; i < m_threads.size(); ++i)
@@ -249,14 +251,10 @@ struct ThreadedRegexVM
if (step(i) == StepResult::Matched)
{
m_captures = std::move(m_threads[i].saves);
- if (flags & RegexExecFlags::AnyMatch)
- return true;
-
- found_match = true;
- m_threads.resize(i); // remove this and lower priority threads
+ return true;
}
}
- return found_match;
+ return false;
}
void add_thread(int index, const char* inst, Vector<Iterator> saves)