Skip to content

Commit 40e0aa1

Browse files
Merge pull request #418 from keepgoing147/patch-1
[golang] Simplify stack IsEmpty function
2 parents 0ae7a5a + d90ba18 commit 40e0aa1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

go/08_stack/StackBasedOnLinkedList.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ func NewLinkedListStack() *LinkedListStack {
2020
}
2121

2222
func (this *LinkedListStack) IsEmpty() bool {
23-
if this.topNode == nil {
24-
return true
25-
}
26-
return false
23+
return this.topNode == nil
2724
}
2825

2926
func (this *LinkedListStack) Push(v interface{}) {

0 commit comments

Comments
 (0)