Skip to content

Commit

Permalink
Merge pull request wangzheng0822#418 from keepgoing147/patch-1
Browse files Browse the repository at this point in the history
[golang] Simplify stack IsEmpty function
  • Loading branch information
wangzheng0822 authored Nov 17, 2019
2 parents 0ae7a5a + d90ba18 commit 40e0aa1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions go/08_stack/StackBasedOnLinkedList.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ func NewLinkedListStack() *LinkedListStack {
}

func (this *LinkedListStack) IsEmpty() bool {
if this.topNode == nil {
return true
}
return false
return this.topNode == nil
}

func (this *LinkedListStack) Push(v interface{}) {
Expand Down

0 comments on commit 40e0aa1

Please sign in to comment.