diff options
author | Abseil Team <absl-team@google.com> | 2023-03-21 09:35:52 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-03-21 09:36:37 (GMT) |
commit | e9faae170f8ab3086a76c299f19d659ba6079967 (patch) | |
tree | 1c9a6e4164ba3311c451204cd4d37a24d657a070 /googlemock/include/gmock | |
parent | fa87209829d47f3fd7c6faf4e99d7d8799e3563d (diff) | |
download | googletest-e9faae170f8ab3086a76c299f19d659ba6079967.zip googletest-e9faae170f8ab3086a76c299f19d659ba6079967.tar.gz googletest-e9faae170f8ab3086a76c299f19d659ba6079967.tar.bz2 |
Internal Code Change
PiperOrigin-RevId: 518213370
Change-Id: I88d0acc195dadf8d03cd15c8534c721141db14ea
Diffstat (limited to 'googlemock/include/gmock')
-rw-r--r-- | googlemock/include/gmock/gmock-matchers.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index a480576..7c5d65c 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -563,7 +563,7 @@ namespace internal { // If the explanation is not empty, prints it to the ostream. inline void PrintIfNotEmpty(const std::string& explanation, ::std::ostream* os) { - if (explanation != "" && os != nullptr) { + if (!explanation.empty() && os != nullptr) { *os << ", " << explanation; } } @@ -2966,7 +2966,7 @@ class KeyMatcherImpl : public MatcherInterface<PairType> { const bool match = inner_matcher_.MatchAndExplain( pair_getters::First(key_value, Rank0()), &inner_listener); const std::string explanation = inner_listener.str(); - if (explanation != "") { + if (!explanation.empty()) { *listener << "whose first field is a value " << explanation; } return match; @@ -3113,12 +3113,12 @@ class PairMatcherImpl : public MatcherInterface<PairType> { const std::string& second_explanation, MatchResultListener* listener) const { *listener << "whose both fields match"; - if (first_explanation != "") { + if (!first_explanation.empty()) { *listener << ", where the first field is a value " << first_explanation; } - if (second_explanation != "") { + if (!second_explanation.empty()) { *listener << ", "; - if (first_explanation != "") { + if (!first_explanation.empty()) { *listener << "and "; } else { *listener << "where "; |