MCPcopy Create free account
hub / github.com/FastLED/FastLED / operator<

Method operator<

src/fl/stl/bitset.h:734–745  ·  view source on GitHub ↗

Lexicographic comparison

Source from the content-addressed store, hash-verified

732
733 /// Lexicographic comparison
734 bool operator<(const bitset_inlined &other) const FL_NOEXCEPT {
735 fl::u32 min_size = size() < other.size() ? size() : other.size();
736 for (fl::u32 i = min_size; i > 0; --i) {
737 bool this_bit = test(i - 1);
738 bool other_bit = other.test(i - 1);
739 if (this_bit != other_bit) {
740 return !this_bit; // false < true
741 }
742 }
743 // All common bits are equal, shorter is less
744 return size() < other.size();
745 }
746
747 bool operator<=(const bitset_inlined &other) const FL_NOEXCEPT {
748 return *this < other || *this == other;

Callers

nothing calls this directly

Calls 3

sizeFunction · 0.70
sizeMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected