MCPcopy Create free account
hub / github.com/Snapchat/Valdi / find

Method find

valdi_protobuf/src/valdi_protobuf/FieldMap.cpp:122–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122Field* FieldMap::find(FieldNumber i) {
123 if (VALDI_UNLIKELY(_isMap)) {
124 auto& map = getMap();
125 auto it = map.find(i);
126 if (it == map.end()) {
127 return nullptr;
128 }
129 return &it->second;
130 } else {
131 auto& vec = getVec();
132 if (i >= vec.size()) {
133 return nullptr;
134 }
135 auto& item = vec[i];
136 if (item.isUnset()) {
137 return nullptr;
138 }
139 return &item;
140 }
141}
142
143const Field* FieldMap::find(FieldNumber i) const {
144 if (VALDI_UNLIKELY(_isMap)) {

Callers 15

_parse_propertiesFunction · 0.45
TESTFunction · 0.45
eraseMethod · 0.45
FindFileByNameMethod · 0.45
getSymbolIndexForNameMethod · 0.45
getFieldMethod · 0.45
postprocessMethod · 0.45
addSymbolMethod · 0.45
readFileCachedFunction · 0.45
parseMetaDataFunction · 0.45

Calls 3

isUnsetMethod · 0.80
endMethod · 0.65
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.36