Method: Barray::BitArray#toggle
- Defined in:
- lib/barray.rb
#toggle(position) ⇒ Object
50 51 52 53 |
# File 'lib/barray.rb', line 50 def toggle(position) ensure_position!(position) data.setbyte(position / 8, (data.getbyte(position / 8) ^ (1 << (position % 8)))) end |