Improve str concatenation performance on MatchesTest Update str concatenation, instead of use operation+ use absl::StrCat whenever available. PiperOrigin-RevId: 874649732 Change-Id: I0acd91c04a9e50fa306e7130479bc330c1a0f068
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 3f80791..8a38018 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc
@@ -885,7 +885,11 @@ // and does not match the negative filter. bool MatchesTest(const std::string& test_suite_name, const std::string& test_name) const { +#ifdef GTEST_HAS_ABSL + return MatchesName(absl::StrCat(test_suite_name, ".", test_name)); +#else return MatchesName(test_suite_name + "." + test_name); +#endif } // Returns true if and only if name matches the positive filter and does not