v0.0.63
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user