MCPcopy Create free account
hub / github.com/catboost/catboost / equal_range_i

Method equal_range_i

util/generic/hash_table.h:1137–1162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1135template <class V, class K, class HF, class Ex, class Eq, class A>
1136template <class OtherKey>
1137std::pair<__yhashtable_iterator<V>, __yhashtable_iterator<V>> THashTable<V, K, HF, Ex, Eq, A>::equal_range_i(const OtherKey& key, insert_ctx& ins) {
1138 using pii = std::pair<iterator, iterator>;
1139 const size_type n = bkt_num_key(key);
1140 ins = &buckets[n];
1141 node* first = buckets[n];
1142
1143 if (first) { /*y*/
1144 for (; !((uintptr_t)first & 1); first = first->next) { /*y*/
1145 if (equals(get_key(first->val), key)) {
1146 for (node* cur = first->next; !((uintptr_t)cur & 1); cur = cur->next) {
1147 if (!equals(get_key(cur->val), key)) {
1148 return pii(iterator(first), iterator(cur)); /*y*/
1149 }
1150 }
1151 for (size_type m = n + 1; m < buckets.size(); ++m) { /*y*/
1152 if (buckets[m]) {
1153 return pii(iterator(first), /*y*/
1154 iterator(buckets[m])); /*y*/
1155 }
1156 }
1157 return pii(iterator(first), end()); /*y*/
1158 }
1159 }
1160 }
1161 return pii(end(), end());
1162}
1163
1164template <class V, class K, class HF, class Ex, class Eq, class A>
1165template <class OtherKey>

Callers

nothing calls this directly

Calls 4

equalsFunction · 0.85
endFunction · 0.70
iteratorClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected