mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +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:
parent
7ebc866418
commit
955d5affa8
103 changed files with 877 additions and 849 deletions
|
@ -583,9 +583,7 @@ void ShaderTextEditor::_update_warning_panel() {
|
|||
int warning_count = 0;
|
||||
|
||||
warnings_panel->push_table(2);
|
||||
for (int i = 0; i < warnings.size(); i++) {
|
||||
ShaderWarning &w = warnings[i];
|
||||
|
||||
for (const ShaderWarning &w : warnings) {
|
||||
if (warning_count == 0) {
|
||||
if (saved_treat_warning_as_errors) {
|
||||
String error_text = "error(" + itos(w.get_line()) + "): " + w.get_message() + " " + TTR("Warnings should be fixed to prevent errors.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue