mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-11 16:22:26 +08:00
docs: update Peak function comment
This commit is contained in:
@@ -47,7 +47,7 @@ func (s *ArrayStack[T]) Pop() (*T, error) {
|
|||||||
return &topItem, nil
|
return &topItem, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Peak return the top element of stack then return it
|
// Peak return the top element of stack
|
||||||
func (s *ArrayStack[T]) Peak() (*T, error) {
|
func (s *ArrayStack[T]) Peak() (*T, error) {
|
||||||
if s.IsEmpty() {
|
if s.IsEmpty() {
|
||||||
return nil, errors.New("stack is empty")
|
return nil, errors.New("stack is empty")
|
||||||
|
|||||||
Reference in New Issue
Block a user