MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / compare

Method compare

extern/re2/re2/stringpiece.h:137–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135 StringPiece substr(size_type pos = 0, size_type n = npos) const;
136
137 int compare(const StringPiece& x) const {
138 size_type min_size = std::min(size(), x.size());
139 if (min_size > 0) {
140 int r = memcmp(data(), x.data(), min_size);
141 if (r < 0) return -1;
142 if (r > 0) return 1;
143 }
144 if (size() < x.size()) return -1;
145 if (size() > x.size()) return 1;
146 return 0;
147 }
148
149 // Does "this" start with "x"?
150 bool starts_with(const StringPiece& x) const {

Callers

nothing calls this directly

Calls 5

minClass · 0.85
sizeFunction · 0.50
dataFunction · 0.50
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected