Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 48c6b11

Browse files
committed
style($parse): simplifying some while(true) loops
1 parent 12eb24d commit 48c6b11

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

Diff for: src/ng/parse.js

+6-12
Original file line numberDiff line numberDiff line change
@@ -545,13 +545,10 @@ Parser.prototype = {
545545
filterChain: function() {
546546
var left = this.expression();
547547
var token;
548-
while (true) {
549-
if ((token = this.expect('|'))) {
550-
left = this.binaryFn(left, token.fn, this.filter());
551-
} else {
552-
return left;
553-
}
548+
while ((token = this.expect('|'))) {
549+
left = this.binaryFn(left, token.fn, this.filter());
554550
}
551+
return left;
555552
},
556553

557554
filter: function() {
@@ -624,13 +621,10 @@ Parser.prototype = {
624621
logicalOR: function() {
625622
var left = this.logicalAND();
626623
var token;
627-
while (true) {
628-
if ((token = this.expect('||'))) {
629-
left = this.binaryFn(left, token.fn, this.logicalAND());
630-
} else {
631-
return left;
632-
}
624+
while ((token = this.expect('||'))) {
625+
left = this.binaryFn(left, token.fn, this.logicalAND());
633626
}
627+
return left;
634628
},
635629

636630
logicalAND: function() {

0 commit comments

Comments
 (0)