Skip to content

Commit e3d2328

Browse files
author
George Bouroutzoglou
committed
fixed index check in set that was always valid
1 parent 18bdb2a commit e3d2328

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/gr/geompokon/bitarray/BitArray.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public Boolean get(int index) {
198198
*/
199199
public Boolean set(int index, Boolean bit) {
200200
Objects.requireNonNull(bit);
201-
ensureIndexInRange(0, elements - 1);
201+
ensureIndexInRange(index, elements - 1);
202202
modCount++;
203203
// get bit indices
204204
int longIndex = getLongIndex(index);

0 commit comments

Comments
 (0)