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
It resets it to 1 while it should better use startIndex. This has consequences when the start index is 0. Even better, it should use minIndex if it exists.
It does not reset eof. Suppose that we start from the following buffer {first=10, length=5, eof=true}. Now we remove the 5 elements in the buffer. It leads to a situation where first=1 but eof=true. As a result, it thinks that 1 is the latest element and thus it does not display the remaining ones up to 10.
The spec file contains scenarios, you may see how the indexes are evolving during cleaning the Buffer with and without immutableTop option in BOF/EOF and non-BOF/EOF cases.
Looks like it works without changes you suggested above. Moreover, my buffer.js change is also unnecessary. It is here for a consistency purpose that doesn't impact the behaviour.
May I ask you to look at this and say what do you think? does it satisfy your needs? do you have some scenarios which would be broken with this approach? can you introduce these scenarios in BufferCleanupSpec?
buffer.remove()
resets its first index when it gets empty with the code bellow:This actually has a few issues:
1
while it should better usestartIndex
. This has consequences when the start index is0
. Even better, it should useminIndex
if it exists.{first=10, length=5, eof=true}
. Now we remove the 5 elements in the buffer. It leads to a situation wherefirst=1
buteof=true
. As a result, it thinks that1
is the latest element and thus it does not display the remaining ones up to 10.I suggest the following fix:
The text was updated successfully, but these errors were encountered: