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

Method operator|

src/fl/stl/bitset.h:658–686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656 }
657
658 friend bitset_inlined operator|(const bitset_inlined &lhs,
659 const bitset_inlined &rhs) FL_NOEXCEPT {
660 bitset_inlined result = lhs;
661
662 if (result._storage.template is<fixed_bitset>() &&
663 rhs._storage.template is<fixed_bitset>()) {
664 // Both are fixed, use the fixed implementation
665 *result._storage.template ptr<fixed_bitset>() |=
666 *rhs._storage.template ptr<fixed_bitset>();
667 } else {
668 // At least one is dynamic, handle bit by bit
669 fl::u32 max_size =
670 result.size() > rhs.size() ? result.size() : rhs.size();
671
672 // Resize if needed
673 if (result.size() < max_size) {
674 result.resize(max_size);
675 }
676
677 // Set bits from rhs
678 for (fl::u32 i = 0; i < rhs.size(); ++i) {
679 if (rhs.test(i)) {
680 result.set(i);
681 }
682 }
683 }
684
685 return result;
686 }
687
688 friend bitset_inlined operator^(const bitset_inlined &lhs,
689 const bitset_inlined &rhs) FL_NOEXCEPT {

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
resizeMethod · 0.45
testMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected