MCPcopy Create free account
hub / github.com/apache/fory / contains

Method contains

cpp/fory/util/flat_int_map.h:260–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258 }
259
260 FORY_ALWAYS_INLINE bool contains(K key) const {
261 if (FORY_PREDICT_FALSE(key == k_empty))
262 return false;
263 Entry *entries = entries_.get();
264 size_t mask = mask_;
265 size_t idx = place(key);
266 while (true) {
267 K k = entries[idx].key;
268 if (k == key)
269 return true;
270 if (k == k_empty)
271 return false;
272 idx = (idx + 1) & mask;
273 }
274 }
275 size_t size() const { return size_; }
276 size_t capacity() const { return capacity_; }
277 bool empty() const { return size_ == 0; }

Callers 1

TEST_FFunction · 0.45

Calls 1

getMethod · 0.65

Tested by 1

TEST_FFunction · 0.36