diff --git a/dataext/stack.go b/dataext/stack.go index d25d653..3530c5c 100644 --- a/dataext/stack.go +++ b/dataext/stack.go @@ -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 +}