From 017ff3179007fa578b225bed5caaeafa73a183b6 Mon Sep 17 00:00:00 2001 From: copygirl Date: Fri, 27 Sep 2024 09:43:38 +0200 Subject: [PATCH] Add EntityIndex::EMPTY --- src/ecs/entity_index.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ecs/entity_index.rs b/src/ecs/entity_index.rs index f77d67c..303b6e7 100644 --- a/src/ecs/entity_index.rs +++ b/src/ecs/entity_index.rs @@ -58,8 +58,10 @@ pub struct EntityIndex { } impl EntityIndex { + pub const EMPTY: EntityIndex = Self::new(); + #[must_use] - pub fn new() -> Self { + pub const fn new() -> Self { Self { dense: Vec::new(), alive_count: 0,