Skip to content

Commit

Permalink
Make events reuse buffers (#2850)
Browse files Browse the repository at this point in the history
I'm really curious why this wasn't the case already...
  • Loading branch information
TheRawMeatball committed Sep 22, 2021
1 parent 615d43b commit 29d4faa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,12 @@ impl<T: Component> Events<T> {
pub fn update(&mut self) {
match self.state {
State::A => {
self.events_b = Vec::new();
self.events_b.clear();
self.state = State::B;
self.b_start_event_count = self.event_count;
}
State::B => {
self.events_a = Vec::new();
self.events_a.clear();
self.state = State::A;
self.a_start_event_count = self.event_count;
}
Expand Down

0 comments on commit 29d4faa

Please sign in to comment.