Skip to content

Commit 902eb1e

Browse files
author
Peter Cooper
authored
Merge pull request #6 from JoshuaSP/patch-1
Allow initializing bit array with a field
2 parents 0ff67e6 + dc7c180 commit 902eb1e

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)