Skip to content

Commit 68c7992

Browse files
author
Mike Atlas
committed
peek should return the first item in the queue
1 parent b5b42fa commit 68c7992

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

queue/queue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (items *items) peek() (interface{}, bool) {
102102
return nil, false
103103
}
104104

105-
return (*items)[length-1], true
105+
return (*items)[0], true
106106
}
107107

108108
func (items *items) getUntil(checker func(item interface{}) bool) []interface{} {

0 commit comments

Comments
 (0)