Skip to content

Commit aaf0693

Browse files
revert to older #total_set
1 parent 8c18b85 commit aaf0693

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/bitarray.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def each_byte
4949
# Returns the total number of bits that are set
5050
# (The technique used here is about 6 times faster than using each or inject direct on the bitfield)
5151
def total_set
52-
each_byte.inject(0) { |a, byte| a += byte & 1 and byte >>= 1 until byte == 0; a }
52+
@field.bytes.inject(0) { |a, byte| a += byte & 1 and byte >>= 1 until byte == 0; a }
5353
end
5454

5555
def byte_position(position)

0 commit comments

Comments
 (0)