v0.0.62
This commit is contained in:
parent
ae952b2166
commit
e46f8019ec
@ -96,3 +96,12 @@ func (s *Stack[T]) OptPeek() *T {
|
||||
|
||||
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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user