We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e24928a commit 20a17adCopy full SHA for 20a17ad
lib/bitarray.rb
@@ -5,9 +5,9 @@ class BitArray
5
6
ELEMENT_WIDTH = 32
7
8
- def initialize(size)
+ def initialize(size, field = nil)
9
@size = size
10
- @field = Array.new(((size - 1) / ELEMENT_WIDTH) + 1, 0)
+ @field = field || Array.new(((size - 1) / ELEMENT_WIDTH) + 1, 0)
11
end
12
13
# Set a bit (1/0)
0 commit comments