Skip to content

Commit

Permalink
Use while (true) instead of for (;;) (#16354)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Jun 5, 2024
1 parent 1c43973 commit 4a5b26f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/language-js/print/assignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function shouldBreakAfterOperator(path, options, print, hasShortKey) {

let node = rightNode;
const propertiesForPath = [];
for (;;) {
while (true) {
if (
node.type === "UnaryExpression" ||
node.type === "AwaitExpression" ||
Expand Down
2 changes: 1 addition & 1 deletion src/main/range-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function findCommonAncestor(startNodeAndParents, endNodeAndParents) {

function dropRootParents(parents) {
let lastParentIndex = parents.length - 1;
for (;;) {
while (true) {
const parent = parents[lastParentIndex];
if (parent?.type === "Program" || parent?.type === "File") {
lastParentIndex--;
Expand Down

0 comments on commit 4a5b26f

Please sign in to comment.