MCPcopy Create free account
hub / github.com/PaddlePaddle/Serving / split

Function split

tools/cpp_examples/demo-client/src/ctr_prediction.cpp:51–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49std::vector<std::vector<int>> response_time;
50
51std::vector<std::string> split(const std::string& str,
52 const std::string& pattern) {
53 std::vector<std::string> res;
54 if (str == "") return res;
55 std::string strs = str + pattern;
56 size_t pos = strs.find(pattern);
57 while (pos != strs.npos) {
58 std::string temp = strs.substr(0, pos);
59 res.push_back(temp);
60 strs = strs.substr(pos + 1, strs.size());
61 pos = strs.find(pattern);
62 }
63 return res;
64}
65
66/**
67 * Simulate CPython hash function on string objects

Callers 1

create_reqFunction · 0.70

Calls 3

findMethod · 0.80
push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected