FastLED
3.10.9
Loading...
Searching...
No Matches
◆
find_index()
template<typename
Key
, typename T, typename
Hash
= Hash<Key>, typename KeyEqual = EqualTo<Key>, int INLINED_COUNT = FASTLED_HASHMAP_INLINED_COUNT>
fl::size
fl::unordered_map
<
Key
, T,
Hash
, KeyEqual, INLINED_COUNT >::find_index
(
const
Key
&
key
)
const
inline
private
Definition at line
883
of file
unordered_map.h
.
883
{
884
const
fl::size
cap
=
_buckets
.size();
885
const
fl::size
mask
=
cap
- 1;
886
const
fl::size
h
=
_hash
(
key
) &
mask
;
887
888
// Probe via the shared helper -- see find_slot() comment above.
889
for
(
fl::size
i
= 0;
i
<
cap
; ++
i
) {
890
const
fl::size
idx
=
detail::unordered_map_probe_idx
(
h
,
i
,
mask
,
cap
);
891
if
(
is_empty
(
idx
))
892
return
npos
();
893
if
(
is_occupied
(
idx
) &&
_equal
(
_buckets
[
idx
].
key
,
key
))
894
return
idx
;
895
}
896
897
return
npos
();
898
}
fl::unordered_map::_hash
Hash _hash
Definition
unordered_map.h:1084
fl::unordered_map::is_occupied
bool is_occupied(fl::size idx) const FL_NO_EXCEPT
Definition
unordered_map.h:810
fl::unordered_map::_equal
KeyEqual _equal
Definition
unordered_map.h:1085
fl::unordered_map::npos
static fl::size npos() FL_NO_EXCEPT
Definition
unordered_map.h:805
fl::unordered_map::_buckets
fl::vector_inlined< Entry, INLINED_COUNT > _buckets
Definition
unordered_map.h:1078
fl::unordered_map::is_empty
bool is_empty(fl::size idx) const FL_NO_EXCEPT
Definition
unordered_map.h:814
fl::unordered_map
Definition
unordered_map.h:61
fl::detail::unordered_map_probe_idx
FL_NO_INLINE fl::size unordered_map_probe_idx(fl::size h, fl::size i, fl::size mask, fl::size cap) FL_NO_EXCEPT
Definition
unordered_map_basic.cpp.hpp:14
fl
unordered_map
Generated on Mon Nov 2 2026 09:25:25 for FastLED by
1.13.2