From 570c43fdd51df9abecb5981c0c045d5ccb843278 Mon Sep 17 00:00:00 2001 From: Daniel Miller Date: Sun, 21 Apr 2024 17:42:04 -0700 Subject: [PATCH] ButtonInput docs - performance cost adjustment (#13047) Adjusted the documentation to better describe the performance cost of `ButtonInput::any_just_pressed|any_just_released|any_pressed`. Each function iterates the full input, but each check is expected constant cost. It was described previously as a full input check, and a full internal list iteration, which I believe is incorrect. --- crates/bevy_input/src/button_input.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bevy_input/src/button_input.rs b/crates/bevy_input/src/button_input.rs index d4d4aca2f9..66e1435298 100644 --- a/crates/bevy_input/src/button_input.rs +++ b/crates/bevy_input/src/button_input.rs @@ -41,9 +41,9 @@ use bevy_ecs::schedule::State; /// /// | **[`ButtonInput`] operations** | **Computational complexity** | /// |-----------------------------------|------------------------------------| -/// | [`ButtonInput::any_just_pressed`] | *O*(m*n) | -/// | [`ButtonInput::any_just_released`] | *O*(m*n) | -/// | [`ButtonInput::any_pressed`] | *O*(m*n) | +/// | [`ButtonInput::any_just_pressed`] | *O*(m)~ | +/// | [`ButtonInput::any_just_released`] | *O*(m)~ | +/// | [`ButtonInput::any_pressed`] | *O*(m)~ | /// | [`ButtonInput::get_just_pressed`] | *O*(n) | /// | [`ButtonInput::get_just_released`] | *O*(n) | /// | [`ButtonInput::get_pressed`] | *O*(n) |