Skip to content

Commit

Permalink
Combine condition check with return value
Browse files Browse the repository at this point in the history
  • Loading branch information
dizco authored Jun 3, 2017
1 parent f0a4cf2 commit 3c4a61c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions iterator/iterator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ namespace IteratorPattern {
}

public hasNext(): boolean {
if (this.position < this.collection.length) {
return true;
} else {
return false;
}
return this.position < this.collection.length;
}
}

Expand Down

0 comments on commit 3c4a61c

Please sign in to comment.