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:
A Thousand Ships 2024-04-15 15:18:34 +02:00
parent 7ebc866418
commit 955d5affa8
No known key found for this signature in database
GPG key ID: 2033189A662F8BD7
103 changed files with 877 additions and 849 deletions

View file

@ -289,7 +289,7 @@ String DirAccessUnix::get_drive(int p_drive) {
ERR_FAIL_INDEX_V(p_drive, list.size(), "");
return list[p_drive];
return list.get(p_drive);
}
int DirAccessUnix::get_current_drive() {