summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/stc/cbits.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/stc/cbits.h b/include/stc/cbits.h
index 58f00e31..3dc78b7d 100644
--- a/include/stc/cbits.h
+++ b/include/stc/cbits.h
@@ -172,9 +172,8 @@ STC_INLINE void _i_memb(_set)(i_type *self, const size_t i)
STC_INLINE void _i_memb(_reset)(i_type *self, const size_t i)
{ self->data64[i>>6] &= ~_cbits_bit(i); }
-STC_INLINE void _i_memb(_set_value)(i_type *self, const size_t i, const bool value) {
- self->data64[i>>6] ^= ((uint64_t)-(int)value ^ self->data64[i>>6]) & _cbits_bit(i);
-}
+STC_INLINE void _i_memb(_set_value)(i_type *self, const size_t i, const bool value)
+ { value ? _i_memb(_set)(self, i) : _i_memb(_reset)(self, i); }
STC_INLINE void _i_memb(_flip)(i_type *self, const size_t i)
{ self->data64[i>>6] ^= _cbits_bit(i); }