MCPcopy Create free account
hub / github.com/FastLED/FastLED / PairCompareWithId

Class PairCompareWithId

src/fl/stl/multi_map.h:56–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54
55 // Comparator that compares only keys
56 struct PairCompareWithId {
57 Compare mComp;
58
59 PairCompareWithId(const Compare& comp = Compare()) : mComp(comp) {}
60
61 bool operator()(const ValueWithId& a, const ValueWithId& b) const {
62 // Compare keys; if keys are equal, compare IDs to maintain stable order
63 if (mComp(a.value.first, b.value.first)) {
64 return true;
65 }
66 if (mComp(b.value.first, a.value.first)) {
67 return false;
68 }
69 // Keys are equal - use ID for ordering
70 return a.unique_id < b.unique_id;
71 }
72 };
73
74 using TreeType = RedBlackTree<ValueWithId, PairCompareWithId, Allocator>;
75 TreeType mTree;

Callers 1

MultiMapTreeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected