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
var b = new CBuffer(10);
b.push(1, 2, 3, 4, 5);
b.rotateLeft();
b.sort();
b.toArray();
=> [1, 1, 2, 3, 4]
Seems the culprit is the use of shift in rotateLeft, which moves the start index but leaves the shifted item in the underlying array. Explicitly setting that array index to undefined seems to fix the above. Not sure if it would have other consequences.
Thanks for the implementation!
The text was updated successfully, but these errors were encountered:
=>
[1, 1, 2, 3, 4]
Seems the culprit is the use of
shift
inrotateLeft
, which moves the start index but leaves the shifted item in the underlying array. Explicitly setting that array index to undefined seems to fix the above. Not sure if it would have other consequences.Thanks for the implementation!
The text was updated successfully, but these errors were encountered: