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.
Loading
Please register or sign in to comment