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!
=>
[1, 1, 2, 3, 4]Seems the culprit is the use of
shiftinrotateLeft, 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!