mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibRegex: Make Matcher<>::match(Vector<>) take a reference to the vector
It was previously copying the entire vector every time, which is not a nice thing to do. :^)
This commit is contained in:
parent
a7653e6a05
commit
d5984d296f
Notes:
sideshowbarker
2024-07-18 07:35:03 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/d5984d296f1 Pull-request: https://github.com/SerenityOS/serenity/pull/9127
@ -111,7 +111,7 @@ RegexResult Matcher<Parser>::match(RegexStringView const& view, Optional<typenam
|
||||
}
|
||||
|
||||
template<typename Parser>
|
||||
RegexResult Matcher<Parser>::match(Vector<RegexStringView> const views, Optional<typename ParserTraits<Parser>::OptionsType> regex_options) const
|
||||
RegexResult Matcher<Parser>::match(Vector<RegexStringView> const& views, Optional<typename ParserTraits<Parser>::OptionsType> regex_options) const
|
||||
{
|
||||
// If the pattern *itself* isn't stateful, reset any changes to start_offset.
|
||||
if (!((AllFlags)m_regex_options.value() & AllFlags::Internal_Stateful))
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
~Matcher() = default;
|
||||
|
||||
RegexResult match(RegexStringView const&, Optional<typename ParserTraits<Parser>::OptionsType> = {}) const;
|
||||
RegexResult match(Vector<RegexStringView> const, Optional<typename ParserTraits<Parser>::OptionsType> = {}) const;
|
||||
RegexResult match(Vector<RegexStringView> const&, Optional<typename ParserTraits<Parser>::OptionsType> = {}) const;
|
||||
|
||||
typename ParserTraits<Parser>::OptionsType options() const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user