Skip to content

Commit

Permalink
Index the session past correctly when discarding.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Jeffrey committed Jan 5, 2017
1 parent 3e1a242 commit 5fd284c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/constellation/constellation.rs
Expand Up @@ -2110,7 +2110,8 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
} else if let Some(frame) = self.frames.get_mut(&frame_change.frame_id) {
debug!("Adding pipeline to existing frame.");
frame.load(frame_change.new_pipeline_id, frame_change.url.clone());
let evicted_id = frame.prev.get_mut(opts::get().max_session_history)
let evicted_id = frame.prev.len().checked_sub(opts::get().max_session_history)
.and_then(|index| frame.prev.get_mut(index))
.and_then(|entry| entry.pipeline_id.take());
(evicted_id, false, true, true)
} else {
Expand Down

0 comments on commit 5fd284c

Please sign in to comment.