diff options
author | Abseil Team <absl-team@google.com> | 2023-03-03 10:24:39 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-03-03 10:25:22 (GMT) |
commit | cead3d57c93ff8c4e5c1bbae57a5c0b0b0f6e168 (patch) | |
tree | 54dfe5650eb1665a57a1ce4828401d3b55adc4a8 | |
parent | 2d4f208765af7fa376b878860a7677ecc0bc390a (diff) | |
download | googletest-cead3d57c93ff8c4e5c1bbae57a5c0b0b0f6e168.zip googletest-cead3d57c93ff8c4e5c1bbae57a5c0b0b0f6e168.tar.gz googletest-cead3d57c93ff8c4e5c1bbae57a5c0b0b0f6e168.tar.bz2 |
Internal Code Change
PiperOrigin-RevId: 513770561
Change-Id: I82fbed177c6ba4e2e5b776ae3e0255c868e32e25
-rw-r--r-- | googlemock/src/gmock-internal-utils.cc | 2 | ||||
-rw-r--r-- | googlemock/src/gmock-matchers.cc | 2 | ||||
-rw-r--r-- | googlemock/src/gmock-spec-builders.cc | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/googlemock/src/gmock-internal-utils.cc b/googlemock/src/gmock-internal-utils.cc index 31d5565..774cce3 100644 --- a/googlemock/src/gmock-internal-utils.cc +++ b/googlemock/src/gmock-internal-utils.cc @@ -87,7 +87,7 @@ GTEST_API_ std::string ConvertIdentifierNameToWords(const char* id_name) { (!IsDigit(prev_char) && IsDigit(*p)); if (IsAlNum(*p)) { - if (starts_new_word && result != "") result += ' '; + if (starts_new_word && !result.empty()) result += ' '; result += ToLower(*p); } } diff --git a/googlemock/src/gmock-matchers.cc b/googlemock/src/gmock-matchers.cc index 5810b6a..07bba4f 100644 --- a/googlemock/src/gmock-matchers.cc +++ b/googlemock/src/gmock-matchers.cc @@ -53,7 +53,7 @@ GTEST_API_ std::string FormatMatcherDescription( bool negation, const char* matcher_name, const std::vector<const char*>& param_names, const Strings& param_values) { std::string result = ConvertIdentifierNameToWords(matcher_name); - if (param_values.size() >= 1) { + if (!param_values.empty()) { result += " " + JoinAsKeyValueTuple(param_names, param_values); } return negation ? "not (" + result + ")" : result; diff --git a/googlemock/src/gmock-spec-builders.cc b/googlemock/src/gmock-spec-builders.cc index afd802c..a7fe911 100644 --- a/googlemock/src/gmock-spec-builders.cc +++ b/googlemock/src/gmock-spec-builders.cc @@ -503,7 +503,7 @@ class MockObjectRegistry { std::cout << internal::FormatFileLocation(state.first_used_file, state.first_used_line); std::cout << " ERROR: this mock object"; - if (state.first_used_test != "") { + if (!state.first_used_test.empty()) { std::cout << " (used in test " << state.first_used_test_suite << "." << state.first_used_test << ")"; } |