Skip to content

Commit

Permalink
Use exist method to be consistent with Stack (trekhleb#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
H2rmone authored Jan 27, 2022
1 parent d227646 commit 8e8f28f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/data-structures/queue/Queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class Queue {
* @return {*}
*/
peek() {
if (!this.linkedList.head) {
if (this.isEmpty()) {
return null;
}

Expand Down

0 comments on commit 8e8f28f

Please sign in to comment.