Skip to content

Commit fab50dc

Browse files
Revert "use while(true) instead of for(;;)"
This reverts commit 31ce275.
1 parent 31ce275 commit fab50dc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/change_stream.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ export class ChangeStream<
648648
hasNext(callback?: Callback): Promise<boolean> | void {
649649
this._setIsIterator();
650650
return maybeCallback(async () => {
651-
while(true) {
651+
for (;;) {
652652
try {
653653
const hasNext = await this.cursor.hasNext();
654654
return hasNext;
@@ -675,7 +675,7 @@ export class ChangeStream<
675675
next(callback?: Callback<TChange>): Promise<TChange> | void {
676676
this._setIsIterator();
677677
return maybeCallback(async () => {
678-
while(true) {
678+
for (;;) {
679679
try {
680680
const change = await this.cursor.next();
681681
const processedChange = this._processChange(change ?? null);
@@ -705,7 +705,7 @@ export class ChangeStream<
705705
tryNext(callback?: Callback<Document | null>): Promise<Document | null> | void {
706706
this._setIsIterator();
707707
return maybeCallback(async () => {
708-
while(true) {
708+
for (;;) {
709709
try {
710710
const change = await this.cursor.tryNext();
711711
return change ?? null;

0 commit comments

Comments
 (0)