Skip to content

Commit

Permalink
Internal Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 513770561
Change-Id: I82fbed177c6ba4e2e5b776ae3e0255c868e32e25
  • Loading branch information
Abseil Team authored and Copybara-Service committed Mar 3, 2023
1 parent 2d4f208 commit cead3d5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion googlemock/src/gmock-internal-utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion googlemock/src/gmock-matchers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion googlemock/src/gmock-spec-builders.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 << ")";
}
Expand Down

0 comments on commit cead3d5

Please sign in to comment.