Compare commits

...

1 Commits

Author SHA1 Message Date
e46f8019ec v0.0.62 2023-01-28 22:29:21 +01:00

View File

@@ -96,3 +96,12 @@ func (s *Stack[T]) OptPeek() *T {
return langext.Ptr(s.data[l-1]) return langext.Ptr(s.data[l-1])
} }
func (s *Stack[T]) Length() int {
if s.lock != nil {
s.lock.Lock()
defer s.lock.Unlock()
}
return len(s.data)
}