You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +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:
@@ -1641,11 +1641,11 @@ String VisualShaderNodeParticleEmit::generate_code(Shader::Mode p_mode, VisualSh
|
||||
|
||||
String flags_str;
|
||||
|
||||
for (int i = 0; i < flags_arr.size(); i++) {
|
||||
if (i > 0) {
|
||||
for (List<String>::ConstIterator itr = flags_arr.begin(); itr != flags_arr.end(); ++itr) {
|
||||
if (itr != flags_arr.begin()) {
|
||||
flags_str += "|";
|
||||
}
|
||||
flags_str += flags_arr[i];
|
||||
flags_str += *itr;
|
||||
}
|
||||
|
||||
if (flags_str.is_empty()) {
|
||||
|
||||
Reference in New Issue
Block a user