This commit is contained in:
2023-01-28 22:29:45 +01:00
parent e46f8019ec
commit 412277b3e0

View File

@@ -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
}