v0.0.63
This commit is contained in:
parent
e46f8019ec
commit
412277b3e0
@ -105,3 +105,12 @@ func (s *Stack[T]) Length() int {
|
||||
|
||||
return len(s.data)
|
||||
}
|
||||
|
||||
func (s *Stack[T]) Empty() bool {
|
||||
if s.lock != nil {
|
||||
s.lock.Lock()
|
||||
defer s.lock.Unlock()
|
||||
}
|
||||
|
||||
return len(s.data) == 0
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user