Skip to content

Commit 007b2b8

Browse files
authored
Merge pull request #7 from dizco/patch-1
Combine condition check with return value
2 parents f0a4cf2 + 3c4a61c commit 007b2b8

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

iterator/iterator.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ namespace IteratorPattern {
2525
}
2626

2727
public hasNext(): boolean {
28-
if (this.position < this.collection.length) {
29-
return true;
30-
} else {
31-
return false;
32-
}
28+
return this.position < this.collection.length;
3329
}
3430
}
3531

0 commit comments

Comments
 (0)