From 955d5affa857ec1f358c56da8fb1ff4ab6590704 Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:18:34 +0200 Subject: 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 --- platform/android/export/export_plugin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'platform/android/export/export_plugin.cpp') diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 3b1a534daf..30d57cade5 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -2974,11 +2974,11 @@ void EditorExportPlatformAndroid::_remove_copied_libs(String p_gdextension_libs_ String EditorExportPlatformAndroid::join_list(const List &p_parts, const String &p_separator) { String ret; - for (int i = 0; i < p_parts.size(); ++i) { - if (i > 0) { + for (List::ConstIterator itr = p_parts.begin(); itr != p_parts.end(); ++itr) { + if (itr != p_parts.begin()) { ret += p_separator; } - ret += p_parts[i]; + ret += *itr; } return ret; } -- cgit v1.2.3