summaryrefslogtreecommitdiff
path: root/src/regex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/regex.cc')
-rw-r--r--src/regex.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/regex.cc b/src/regex.cc
index b62bdddf..e9d24be7 100644
--- a/src/regex.cc
+++ b/src/regex.cc
@@ -1,5 +1,4 @@
#include "regex.hh"
-#include "ranges.hh"
#include "string_utils.hh"
namespace Kakoune
@@ -14,8 +13,12 @@ Regex::Regex(StringView re, RegexCompileFlags flags)
int Regex::named_capture_index(StringView name) const
{
- auto it = find_if(m_impl->named_captures, [&](auto& c) { return c.name == name; });
- return it != m_impl->named_captures.end() ? it->index : -1;
+ for (auto capture : m_impl->named_captures)
+ {
+ if (capture.name == name)
+ return capture.index;
+ }
+ return -1;
}
String option_to_string(const Regex& re, Quoting quoting)