Refactor: getLeftMost use while loop instead of recurse (#8732)

This commit is contained in:
fisker Cheung authored and GitHub committed 2020-07-11 20:06:33 +08:00
1 parent c6b8d0e7d3
commit 9c2c68920e
1 file changed
+2 -2
+2 -2
View File
@@ -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;
}