MCPcopy Create free account
hub / github.com/apple/foundationdb / convertString

Method convertString

fdbrpc/include/fdbrpc/ReplicationTypes.h:163–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161 return (hashValue < _lookuparray.size()) ? _lookuparray[hashValue] : "<missing>";
162 }
163 int convertString(std::string const& value) {
164 int hashValue;
165 auto itValue = _hashmap.find(value);
166 if (itValue != _hashmap.end()) {
167 hashValue = itValue->second;
168 } else {
169 hashValue = _hashmap.size();
170 _hashmap[value] = hashValue;
171 _lookuparray.push_back(value);
172 }
173 return hashValue;
174 }
175 int convertString(char const* value) { return convertString(std::string(value)); }
176 int convertString(StringRef const& value) { return convertString(value.printable()); }
177 int convertString(Optional<Standalone<StringRef>> const& value) {

Callers 3

keyIndexMethod · 0.80
valueIndexMethod · 0.80
LocalitySetClass · 0.80

Calls 7

getMethod · 0.65
findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
printableMethod · 0.45
presentMethod · 0.45

Tested by

no test coverage detected