diff options
author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-04-15 15:18:34 +0200 |
---|---|---|
committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-05-04 16:08:55 +0200 |
commit | 955d5affa857ec1f358c56da8fb1ff4ab6590704 (patch) | |
tree | b667ac9f6f62bff17ce032683c0eb09727660555 /platform/linuxbsd/wayland/wayland_thread.cpp | |
parent | 7ebc866418b075df58cbe4e31fcf8b0c3acd70a1 (diff) | |
download | redot-engine-955d5affa857ec1f358c56da8fb1ff4ab6590704.tar.gz |
Reduce and prevent unnecessary random-access to `List`
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)
* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
Diffstat (limited to 'platform/linuxbsd/wayland/wayland_thread.cpp')
-rw-r--r-- | platform/linuxbsd/wayland/wayland_thread.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/linuxbsd/wayland/wayland_thread.cpp b/platform/linuxbsd/wayland/wayland_thread.cpp index 1701aa650d..aabf1abdda 100644 --- a/platform/linuxbsd/wayland/wayland_thread.cpp +++ b/platform/linuxbsd/wayland/wayland_thread.cpp @@ -3427,7 +3427,7 @@ bool WaylandThread::window_get_idle_inhibition(DisplayServer::WindowID p_window_ WaylandThread::ScreenData WaylandThread::screen_get_data(int p_screen) const { ERR_FAIL_INDEX_V(p_screen, registry.wl_outputs.size(), ScreenData()); - return wl_output_get_screen_state(registry.wl_outputs[p_screen])->data; + return wl_output_get_screen_state(registry.wl_outputs.get(p_screen))->data; } int WaylandThread::get_screen_count() const { |