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

Function LookupNameIndex

cpp/src/arrow/type.cc:1346–1360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

GetFieldIndexMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected