Replace foreachs with for loops

This commit is contained in:
Timothy Warren 2019-11-05 12:37:25 -05:00
parent c16b9aa6f0
commit c7d9f00965

View File

@ -127,9 +127,9 @@ class Editor {
} }
// Update the syntax highlighting for all the rows of the file // Update the syntax highlighting for all the rows of the file
foreach ($this->rows as $row) for ($i = 0; $i < $this->numRows; $i++)
{ {
$row->updateSyntax(); $this->rows[$i]->updateSyntax();
} }
return; return;
@ -926,9 +926,9 @@ class Editor {
private function refreshPHPSyntax(): void private function refreshPHPSyntax(): void
{ {
$this->syntax->tokens = get_php_tokens($this->rowsToString()); $this->syntax->tokens = get_php_tokens($this->rowsToString());
foreach($this->rows as $row) for ($i = 0; $i < $this->numRows; $i++)
{ {
$row->updateSyntax(); $this->rows[$i]->updateSyntax();
} }
} }
} }