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
This commit is contained in:
		
				
					committed by
					
						
						Copybara-Service
					
				
			
			
				
	
			
			
			
						parent
						
							6045bf2ade
						
					
				
				
					commit
					5b909beeec
				
			@@ -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_);
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user