FastLED
3.10.8
Loading...
Searching...
No Matches
◆
find_slot()
template<typename
Key
, typename T, typename
Hash
= Hash<Key>, typename KeyEqual = EqualTo<Key>, int INLINED_COUNT = FASTLED_HASHMAP_INLINED_COUNT>
pair
< fl::size, bool >
fl::unordered_map
<
Key
, T,
Hash
, KeyEqual, INLINED_COUNT >::find_slot
(
const
Key
&
key
)
const
inline
private
Definition at line
848
of file
unordered_map.h
.
848
{
849
const
fl::size
cap
=
_buckets
.size();
850
const
fl::size
mask
=
cap
- 1;
851
const
fl::size
h
=
_hash
(
key
) &
mask
;
852
fl::size
first_tomb
=
npos
();
853
854
// Probe sequence comes from the shared (non-template) helper -- avoids
855
// duplicating the (cap <= 8 ? linear : quadratic-then-linear)
856
// branch logic across every unordered_map<K, V, Hash, Equal>
857
// instantiation. See FastLED #3235 Tier 1C.
858
for
(
fl::size
i
= 0;
i
<
cap
; ++
i
) {
859
const
fl::size
idx
=
detail::unordered_map_probe_idx
(
h
,
i
,
mask
,
cap
);
860
861
if
(
is_empty
(
idx
))
862
return
{
first_tomb
!=
npos
() ?
first_tomb
:
idx
,
true
};
863
if
(
is_deleted
(
idx
)) {
864
if
(
first_tomb
==
npos
())
865
first_tomb
=
idx
;
866
}
else
if
(
is_occupied
(
idx
) &&
_equal
(
_buckets
[
idx
].
key
,
key
)) {
867
return
{
idx
,
false
};
868
}
869
}
870
871
return
{
npos
(),
false
};
872
}
fl::unordered_map::_hash
Hash _hash
Definition
unordered_map.h:1051
fl::unordered_map::is_occupied
bool is_occupied(fl::size idx) const FL_NO_EXCEPT
Definition
unordered_map.h:808
fl::unordered_map::is_deleted
bool is_deleted(fl::size idx) const FL_NO_EXCEPT
Definition
unordered_map.h:810
fl::unordered_map::_equal
KeyEqual _equal
Definition
unordered_map.h:1052
fl::unordered_map::npos
static fl::size npos() FL_NO_EXCEPT
Definition
unordered_map.h:803
fl::unordered_map::_buckets
fl::vector_inlined< Entry, INLINED_COUNT > _buckets
Definition
unordered_map.h:1045
fl::unordered_map::is_empty
bool is_empty(fl::size idx) const FL_NO_EXCEPT
Definition
unordered_map.h:812
fl::unordered_map
Definition
unordered_map.h:59
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 Sun Oct 18 2026 00:57:09 for FastLED by
1.13.2