MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / StrSplit

Function StrSplit

deps/google-benchmark/src/string_util.cc:166–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166std::vector<std::string> StrSplit(const std::string& str, char delim) {
167 if (str.empty()) return {};
168 std::vector<std::string> ret;
169 size_t first = 0;
170 size_t next = str.find(delim);
171 for (; next != std::string::npos;
172 first = next + 1, next = str.find(delim, first)) {
173 ret.push_back(str.substr(first, next - first));
174 }
175 ret.push_back(str.substr(first));
176 return ret;
177}
178
179#ifdef BENCHMARK_STL_ANDROID_GNUSTL
180/*

Callers 4

TESTFunction · 0.85
ParseKvPairsFunction · 0.85
ParseKeyValueFlagFunction · 0.85
BenchmarkRunnerMethod · 0.85

Calls 4

findMethod · 0.80
emptyMethod · 0.45
push_backMethod · 0.45
substrMethod · 0.45

Tested by 1

TESTFunction · 0.68