21
0
Fork 0
This commit is contained in:
Mike Schwörer 2023-01-28 22:29:45 +01:00
parent e46f8019ec
commit 412277b3e0
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
1 changed files with 9 additions and 0 deletions

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
}