MCPcopy Create free account
hub / github.com/ElementsProject/elements / TrimSpace

Function TrimSpace

src/leveldb/benchmarks/db_bench.cc:152–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150
151#if defined(__linux)
152static Slice TrimSpace(Slice s) {
153 size_t start = 0;
154 while (start < s.size() && isspace(s[start])) {
155 start++;
156 }
157 size_t limit = s.size();
158 while (limit > start && isspace(s[limit - 1])) {
159 limit--;
160 }
161 return Slice(s.data() + start, limit - start);
162}
163#endif
164
165static void AppendWithSpace(std::string* str, Slice msg) {

Callers 1

PrintEnvironmentMethod · 0.70

Calls 3

SliceClass · 0.50
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected