You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
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
This commit is contained in:
@@ -2974,11 +2974,11 @@ void EditorExportPlatformAndroid::_remove_copied_libs(String p_gdextension_libs_
|
||||
|
||||
String EditorExportPlatformAndroid::join_list(const List<String> &p_parts, const String &p_separator) {
|
||||
String ret;
|
||||
for (int i = 0; i < p_parts.size(); ++i) {
|
||||
if (i > 0) {
|
||||
for (List<String>::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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user