Skip to content

Commit

Permalink
Clean up sequence match
Browse files Browse the repository at this point in the history
  • Loading branch information
Aceeri committed Dec 21, 2022
1 parent 6f1fa0f commit df18953
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/bevy_ecs/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,9 @@ impl<E: Event> Events<E> {
let sequence = self.sequence(id);
let index = id.saturating_sub(sequence.start_event_count);

match sequence.get(index) {
Some(instance) => Some((&instance.event, instance.event_id)),
None => None,
}
sequence
.get(index)
.map(|instance| (&instance.event, instance.event_id))
}

/// Oldest id still in the events buffer.
Expand Down

0 comments on commit df18953

Please sign in to comment.