Commit 5b909bee authored by Dino Radakovic's avatar Dino Radakovic Committed by Copybara-Service
Browse files

Explicitly instantiate matchee std::string in MatchesRegex

If this ever turns out to be a performance issue, we could use std::conditional and std::is_same to avoid copying std::strings.

Fixes #3949

PiperOrigin-RevId: 465353572
Change-Id: If2d691bccb626c692c87e006df5afe88a4ed1542
parent 6045bf2a
......@@ -842,7 +842,7 @@ class MatchesRegexMatcher {
template <class MatcheeStringType>
bool MatchAndExplain(const MatcheeStringType& s,
MatchResultListener* /* listener */) const {
const std::string& s2(s);
const std::string s2(s);
return full_match_ ? RE::FullMatch(s2, *regex_)
: RE::PartialMatch(s2, *regex_);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment