From 673de33eeb754142a32ac5cad551230d8fc86849 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Mon, 23 May 2022 10:02:47 +0200 Subject: Small simplify in cbits.h --- include/stc/cbits.h | 5 ++--- 1 file 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); } -- cgit v1.2.3