Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lists/singlylinkedlist/singlylinkedlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ func (list *List[T]) Prepend(values ...T) {
// Get returns the element at index.
// Second return parameter is true if index is within bounds of the array and array is not empty, otherwise false.
func (list *List[T]) Get(index int) (T, bool) {

if !list.withinRange(index) {
if !list.withinRange(index) || list.first == nil {
var t T
return t, false
}
Expand Down