From a0dd088a91291dd23a8b79a650c36ddd740fdf22 Mon Sep 17 00:00:00 2001 From: IceSentry Date: Sat, 7 May 2022 17:09:07 -0400 Subject: [PATCH] add warning to is_empty --- crates/bevy_ecs/src/event.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/bevy_ecs/src/event.rs b/crates/bevy_ecs/src/event.rs index 63a88d175954d0..056262cc62843a 100644 --- a/crates/bevy_ecs/src/event.rs +++ b/crates/bevy_ecs/src/event.rs @@ -286,6 +286,7 @@ impl<'w, 's, T: Resource> EventReader<'w, 's, T> { /// Determines if there are any events available to be read without consuming any. /// If you need to consume the iterator you can use [`EventReader::any`] + /// WARNING: `events.is_empty()` is not the same as doing `!events.any()` pub fn is_empty(&self) -> bool { self.len() == 0 }