Bug 20242 – BitArray constructor should not modify input data

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-09-25T07:56:27Z
Last change time
2019-10-05T12:33:46Z
Keywords
pull
Assigned to
Vladimir Panteleev
Creator
Vladimir Panteleev
Depends on
20241

Comments

Comment #0 by dlang-bugzilla — 2019-09-25T07:56:27Z
Currently BitArray.this has the peculiar behavior in that it modifies the data referenced from its arguments to clear bits past the specified length. This is documented with a big scary warning in its DDoc. However, I don't see why this behavior is necessary for BitArray to work, as it should never be even accessing bits past its designated length, and it stands in the way of some BitArray applications (i.e. building multiple BitArrays from the same immutable source data but with different length).
Comment #1 by dlang-bot — 2019-09-25T08:03:11Z
@CyberShadow created dlang/phobos pull request #7194 "BitArray fixes" fixing this issue: - Fix Issue 20242 - BitArray constructor should not modify input data https://github.com/dlang/phobos/pull/7194
Comment #2 by dlang-bot — 2019-10-05T12:33:46Z
dlang/phobos pull request #7194 "BitArray fixes" was merged into master: - b808e722b1560292a9905b6930a83571f68cf2ec by Vladimir Panteleev: Fix Issue 20242 - BitArray constructor should not modify input data https://github.com/dlang/phobos/pull/7194