diff options
author | Hossein Ghahramanzadeh <hgsilverman@gmail.com> | 2021-12-22 15:22:56 (GMT) |
---|---|---|
committer | Hossein Ghahramanzadeh <hgsilverman@gmail.com> | 2022-01-06 14:46:52 (GMT) |
commit | 4fc151ae6910c250329f72d9254b4a32634c696a (patch) | |
tree | 3f673693dc266c88a4c16ee8f85490968359bcbd /googletest/src/gtest.cc | |
parent | aea981dd54affc0220c94936084e5c0f1c206dd6 (diff) | |
download | googletest-4fc151ae6910c250329f72d9254b4a32634c696a.zip googletest-4fc151ae6910c250329f72d9254b4a32634c696a.tar.gz googletest-4fc151ae6910c250329f72d9254b4a32634c696a.tar.bz2 |
Use normal for loop instead of accumulate.
Diffstat (limited to 'googletest/src/gtest.cc')
-rw-r--r-- | googletest/src/gtest.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 959b3bb..54814d8 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -50,7 +50,6 @@ #include <limits> #include <list> #include <map> -#include <numeric> #include <ostream> // NOLINT #include <sstream> #include <vector> @@ -771,10 +770,11 @@ class PositiveAndNegativeUnitTestFilter { // TODO: Fail on multiple '-' characters // For the moment to preserve old behavior we concatenate the rest of the // string parts with `-` as separator to generate the negative filter. - negative_filter_ = UnitTestFilter{std::accumulate( - positive_and_negative_filters.begin() + 2, - positive_and_negative_filters.end(), positive_and_negative_filters[1], - [](const std::string& lhs, const std::string& rhs) { return lhs + '-' + rhs; })}; + auto negative_filter_string = positive_and_negative_filters[1]; + for (std::size_t i = 2; i < positive_and_negative_filters.size(); i++) + negative_filter_string = + negative_filter_string + '-' + positive_and_negative_filters[i]; + negative_filter_ = UnitTestFilter{negative_filter_string}; } else { // In case we don't have a negative filter and positive filter is "" // we do not use kUniversalFilter by design as opposed to when we have a |