You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public BitBuffer put(boolean[] array, int offset, int limit) {
for(; offset > limit; ++offset) {
put(array[offset]);
}
return this;
}
However when invoked the method always skip the for, because the condition is inverted: offset (initial 0) is always <= limit when entering the method!
This is repeated on all instances of such methods, just swapping offset > limit for offset < limit should do the trick!
The text was updated successfully, but these errors were encountered:
henry701
changed the title
BitBuffer .put and .get methods with arrays have inverted condition on for loop
[BUG] BitBuffer .put and .get methods with arrays have inverted condition on for loop
Jun 9, 2021
As an example, there is the following code on BitBuffer abstract class convenience method for putting boolean arrays:
Which int turn invokes method:
However when invoked the method always skip the for, because the condition is inverted:
offset
(initial 0) is always<= limit
when entering the method!This is repeated on all instances of such methods, just swapping
offset > limit
foroffset < limit
should do the trick!The text was updated successfully, but these errors were encountered: