Skip to content
  • Mark OLESEN's avatar
    BUG: bitSet &= operation does not mask out non-overlapping (#2456) · 036abb8e
    Mark OLESEN authored
    - the values from non-overlapping blocks were simply ignored,
      which meant that ('111111111111' & '111111') would not mask out
      the unset values at all.
    
    - similar oddities in other operations (|=, ^= etc)
      where the original implementation tried hard to avoid touching the
      sizing at all, but now better resolved as follows:
    
      - '|=' : Set may grow to accommodate new 'on' bits.
      - '^=' : Set may grow to accommodate new 'on' bits.
      - '-=' : Never changes the original set size.
      - '&=' : Never changes the original set size.
               Non-overlapping elements are considered 'off'.
    
      These definitions are consistent with HashSet behaviour
      and also ensures that (a & b) == (b & a)
    
    ENH: improve short-circuiting within bitSet ops
    
    - in a few places can optimise by checking for none() instead of
      empty() and avoid unnecessary block operations.
    
    ENH: added bitSet::resize_last() method
    
    - as the name says: resizes to the last bit set.
      ...
    036abb8e