aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/include
diff options
context:
space:
mode:
Diffstat (limited to 'googlemock/include')
-rw-r--r--googlemock/include/gmock/gmock-matchers.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h
index a9648835..b8ec24dd 100644
--- a/googlemock/include/gmock/gmock-matchers.h
+++ b/googlemock/include/gmock/gmock-matchers.h
@@ -758,8 +758,7 @@ class HasSubstrMatcher {
template <typename MatcheeStringType>
bool MatchAndExplain(const MatcheeStringType& s,
MatchResultListener* /* listener */) const {
- const StringType& s2(s);
- return s2.find(substring_) != StringType::npos;
+ return StringType(s).find(substring_) != StringType::npos;
}
// Describes what this matcher matches.