MCPcopy Create free account
hub / github.com/alibaba/zvec / string_replace

Method string_replace

src/db/sqlengine/common/util.cc:54–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void Util::string_replace(const std::string &src, const std::string &dst,
55 std::string *str) {
56 std::string::size_type pos = 0;
57 std::string::size_type srclen = src.size();
58 std::string::size_type dstlen = dst.size();
59
60 while ((pos = str->find(src, pos)) != std::string::npos) {
61 str->replace(pos, srclen, dst);
62 pos += dstlen;
63 }
64
65 return;
66}
67
68// normalize sql for parse result after parse
69std::string Util::normalize(const std::string &sql) {

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
findMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected