Skip to content

Commit 570c43f

Browse files
authored
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.
1 parent c40b485 commit 570c43f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/bevy_input/src/button_input.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ use bevy_ecs::schedule::State;
4141
///
4242
/// | **[`ButtonInput`] operations** | **Computational complexity** |
4343
/// |-----------------------------------|------------------------------------|
44-
/// | [`ButtonInput::any_just_pressed`] | *O*(m*n) |
45-
/// | [`ButtonInput::any_just_released`] | *O*(m*n) |
46-
/// | [`ButtonInput::any_pressed`] | *O*(m*n) |
44+
/// | [`ButtonInput::any_just_pressed`] | *O*(m)~ |
45+
/// | [`ButtonInput::any_just_released`] | *O*(m)~ |
46+
/// | [`ButtonInput::any_pressed`] | *O*(m)~ |
4747
/// | [`ButtonInput::get_just_pressed`] | *O*(n) |
4848
/// | [`ButtonInput::get_just_released`] | *O*(n) |
4949
/// | [`ButtonInput::get_pressed`] | *O*(n) |

0 commit comments

Comments
 (0)