Skip to content

Commit 31ce275

Browse files
use while(true) instead of for(;;)
1 parent 84c4c78 commit 31ce275

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-
for (;;) {
651+
while(true) {
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-
for (;;) {
678+
while(true) {
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-
for (;;) {
708+
while(true) {
709709
try {
710710
const change = await this.cursor.tryNext();
711711
return change ?? null;

0 commit comments

Comments
 (0)