Skip to content

Commit 4fc151a

Browse files
Use normal for loop instead of accumulate.
1 parent aea981d commit 4fc151a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

googletest/src/gtest.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
#include <limits>
5151
#include <list>
5252
#include <map>
53-
#include <numeric>
5453
#include <ostream> // NOLINT
5554
#include <sstream>
5655
#include <vector>
@@ -771,10 +770,11 @@ class PositiveAndNegativeUnitTestFilter {
771770
// TODO: Fail on multiple '-' characters
772771
// For the moment to preserve old behavior we concatenate the rest of the
773772
// string parts with `-` as separator to generate the negative filter.
774-
negative_filter_ = UnitTestFilter{std::accumulate(
775-
positive_and_negative_filters.begin() + 2,
776-
positive_and_negative_filters.end(), positive_and_negative_filters[1],
777-
[](const std::string& lhs, const std::string& rhs) { return lhs + '-' + rhs; })};
773+
auto negative_filter_string = positive_and_negative_filters[1];
774+
for (std::size_t i = 2; i < positive_and_negative_filters.size(); i++)
775+
negative_filter_string =
776+
negative_filter_string + '-' + positive_and_negative_filters[i];
777+
negative_filter_ = UnitTestFilter{negative_filter_string};
778778
} else {
779779
// In case we don't have a negative filter and positive filter is ""
780780
// we do not use kUniversalFilter by design as opposed to when we have a

0 commit comments

Comments
 (0)