MCPcopy Create free account
hub / github.com/apache/arrow / LookupNameIndex

Function LookupNameIndex

cpp/src/arrow/type.cc:1343–1357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1341
1342template <int NotFoundValue = -1, int DuplicateFoundValue = -1>
1343int LookupNameIndex(const std::unordered_multimap<std::string_view, int>& name_to_index,
1344 std::string_view name) {
1345 auto p = name_to_index.equal_range(name);
1346 auto it = p.first;
1347 if (it == p.second) {
1348 // Not found
1349 return NotFoundValue;
1350 }
1351 auto index = it->second;
1352 if (++it != p.second) {
1353 // Duplicate field name
1354 return DuplicateFoundValue;
1355 }
1356 return index;
1357}
1358
1359} // namespace
1360

Callers 1

GetFieldIndexMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected