Skip to content

Commit ee94071

Browse files
committed
Don't use loop
1 parent 1460143 commit ee94071

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/Symfony/Component/ExpressionLanguage/Node/GetAttrNode.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,13 @@ public function evaluate(array $functions, array $values)
128128

129129
private function isShortCircuited(): bool
130130
{
131-
$node = $this;
132-
133-
do {
134-
if ($node->isShortCircuited) {
135-
return true;
136-
}
137-
$node = $node->nodes['node'];
138-
} while ($node instanceof self);
131+
if ($this->isShortCircuited) {
132+
return true;
133+
}
134+
135+
if ($this->nodes['node'] instanceof self) {
136+
return $this->nodes['node']->isShortCircuited();
137+
}
139138

140139
return false;
141140
}

0 commit comments

Comments
 (0)