Refactor: getLeftMost use while loop instead of recurse (#8732)
This commit is contained in:
1 parent
c6b8d0e7d3
commit
9c2c68920e
1 file changed
+2
-2
@@ -1147,8 +1147,8 @@ function getPrecedence(op) {
|
||||
}
|
||||
|
||||
function getLeftMost(node) {
|
||||
if (node.left) {
|
||||
return getLeftMost(node.left);
|
||||
while (node.left) {
|
||||
node = node.left;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user