Skip to content
Snippets Groups Projects
Commit 073c8d07 authored by Vladimir Davydov's avatar Vladimir Davydov
Browse files

vinyl: rework cache iterator restore

The cache iterator restoration function is muddy and suboptimal:

 - If last_stmt equals NULL, it doesn't attempt to change the iterator
   position although it should restart the iterator. Moreover, it
   doesn't even check EQ condition in this case, i.e. it may return a
   statement that doesn't satisfy the search criteria.

 - It may restore iterator position to last_stmt, but the restoration
   semantics mandates that the returned statement must be strictly
   greater than last_stmt if the iterator was restored.

 - If the iterator was invalidated, it first positions the iterator to
   the last known position (curr_stmt) and then steps back to the
   statement closest to last_stmt although it could jump to last_stmt
   immediately.

Let's rewrite it.
parent 98ac5be8
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment