Data-Structures-and-Algorithms icon indicating copy to clipboard operation
Data-Structures-and-Algorithms copied to clipboard

fix to DoublyLinkedList.InsertFirst()

Open mandolyte opened this issue 6 years ago • 0 comments

The InsertFirst() method is missing an empty list check. I copied the check from InsertLast() and made the needed changes. This fix is the following 5 lines of code:

	if list.tail == nil {
		list.head = data
		list.tail = data
		return
	}

mandolyte avatar Jul 02 '18 14:07 mandolyte