From 003765a878ec4d9685b48440772783312ca91348 Mon Sep 17 00:00:00 2001 From: Lixou <82600264+DasLixou@users.noreply.github.com> Date: Thu, 9 Nov 2023 01:57:22 +0100 Subject: [PATCH] Remove unnecessary if statement in scheduler (#10446) # Objective There is an if statement checking if a node is present in a graph moments after it explicitly being added. Unless the edge function has super weird side effects and the tests don't pass, this is unnecessary. ## Solution Removed it --- crates/bevy_ecs/src/schedule/schedule.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/crates/bevy_ecs/src/schedule/schedule.rs b/crates/bevy_ecs/src/schedule/schedule.rs index 82732b1a7e..8d65f61119 100644 --- a/crates/bevy_ecs/src/schedule/schedule.rs +++ b/crates/bevy_ecs/src/schedule/schedule.rs @@ -859,10 +859,6 @@ impl ScheduleGraph { self.dependency.graph.add_node(set); } - if !self.dependency.graph.contains_node(id) { - self.dependency.graph.add_node(id); - } - for (kind, set) in dependencies .into_iter() .map(|Dependency { kind, set }| (kind, self.system_set_ids[&set]))