- /*
- * It is possible that an event was read during
- * the last restore, never consumed and its
- * position saved again. For this case, we
- * need to check if the event really was
- * consumed by the caller otherwise it is lost.
- */
- if (stream->consumed)
- saved_pos.offset = cfs->pos.offset;
- else
- saved_pos.offset = cfs->pos.last_offset;
-
- saved_pos.current_timestamp = stream->timestamp;
-
- g_array_append_val(
- pos->u.restore->stream_saved_pos,
- saved_pos);
-
- printf_debug("stream : %" PRIu64 ", cur_index : %zd, "
- "offset : %zd, "
- "timestamp = %" PRIu64 "\n",
- stream->stream_id, saved_pos.cur_index,
- saved_pos.offset,
- saved_pos.current_timestamp);
- }
- }
- }
+ /* remove the stream from the heap copy */
+ removed = heap_remove(&iter_heap_copy);
+ assert(removed == file_stream);