Skip to content

Commit dc7c180

Browse files
authored
Allow initializing bit array with a field
1 parent 6018faa commit dc7c180

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
@@ -7,7 +7,7 @@ class BitArray
77

88
def initialize(size, field = nil)
99
@size = size
10-
@field = "\0" * (size / 8 + 1)
10+
@field = field || "\0" * (size / 8 + 1)
1111
end
1212

1313
# Set a bit (1/0)

0 commit comments

Comments
 (0)