v0.0.62
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user