Unverified Commit 6f094ba1 by Norman Heino Committed by GitHub

Fix perf counter argument parsing (#1160)

* Fix argument order in StrSplit * Update AUTHORS, CONTRIBUTORS
parent 4ff73496
...@@ -43,6 +43,7 @@ Matt Clarkson <mattyclarkson@gmail.com> ...@@ -43,6 +43,7 @@ Matt Clarkson <mattyclarkson@gmail.com>
Maxim Vafin <maxvafin@gmail.com> Maxim Vafin <maxvafin@gmail.com>
MongoDB Inc. MongoDB Inc.
Nick Hutchinson <nshutchinson@gmail.com> Nick Hutchinson <nshutchinson@gmail.com>
Norman Heino <norman.heino@gmail.com>
Oleksandr Sochka <sasha.sochka@gmail.com> Oleksandr Sochka <sasha.sochka@gmail.com>
Ori Livneh <ori.livneh@gmail.com> Ori Livneh <ori.livneh@gmail.com>
Paul Redmond <paul.redmond@gmail.com> Paul Redmond <paul.redmond@gmail.com>
......
...@@ -62,6 +62,7 @@ Lei Xu <eddyxu@gmail.com> ...@@ -62,6 +62,7 @@ Lei Xu <eddyxu@gmail.com>
Matt Clarkson <mattyclarkson@gmail.com> Matt Clarkson <mattyclarkson@gmail.com>
Maxim Vafin <maxvafin@gmail.com> Maxim Vafin <maxvafin@gmail.com>
Nick Hutchinson <nshutchinson@gmail.com> Nick Hutchinson <nshutchinson@gmail.com>
Norman Heino <norman.heino@gmail.com>
Oleksandr Sochka <sasha.sochka@gmail.com> Oleksandr Sochka <sasha.sochka@gmail.com>
Ori Livneh <ori.livneh@gmail.com> Ori Livneh <ori.livneh@gmail.com>
Pascal Leroy <phl@google.com> Pascal Leroy <phl@google.com>
......
...@@ -169,7 +169,7 @@ std::vector<std::string> StrSplit(const std::string& str, char delim) { ...@@ -169,7 +169,7 @@ std::vector<std::string> StrSplit(const std::string& str, char delim) {
size_t first = 0; size_t first = 0;
size_t next = str.find(delim); size_t next = str.find(delim);
for (; next != std::string::npos; for (; next != std::string::npos;
first = next + 1, next = str.find(first, delim)) { first = next + 1, next = str.find(delim, first)) {
ret.push_back(str.substr(first, next - first)); ret.push_back(str.substr(first, next - first));
} }
ret.push_back(str.substr(first)); ret.push_back(str.substr(first));
......
...@@ -154,8 +154,8 @@ TEST(StringUtilTest, StrSplit) { ...@@ -154,8 +154,8 @@ TEST(StringUtilTest, StrSplit) {
EXPECT_EQ(benchmark::StrSplit("", ','), std::vector<std::string>{}); EXPECT_EQ(benchmark::StrSplit("", ','), std::vector<std::string>{});
EXPECT_EQ(benchmark::StrSplit("hello", ','), EXPECT_EQ(benchmark::StrSplit("hello", ','),
std::vector<std::string>({"hello"})); std::vector<std::string>({"hello"}));
EXPECT_EQ(benchmark::StrSplit("hello,there", ','), EXPECT_EQ(benchmark::StrSplit("hello,there,is,more", ','),
std::vector<std::string>({"hello", "there"})); std::vector<std::string>({"hello", "there", "is", "more"}));
} }
} // end namespace } // end namespace
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment