Skip to content

Comments

add stack type#1422

Merged
paulwe merged 1 commit intomainfrom
stack-util
Feb 23, 2026
Merged

add stack type#1422
paulwe merged 1 commit intomainfrom
stack-util

Conversation

@paulwe
Copy link
Contributor

@paulwe paulwe commented Feb 23, 2026

No description provided.

@paulwe paulwe requested a review from a team February 23, 2026 05:50
@changeset-bot
Copy link

changeset-bot bot commented Feb 23, 2026

🦋 Changeset detected

Latest commit: a2f8b3f

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "github.com/livekit/protocol" specified in the `fixed` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

}

func (s *Stack[T]) Pop() T {
v := (*s)[len(*s)-1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this okay if stack is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it has to be used carefully

return v
}

func (s Stack[T]) Peek() T {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any specific reason why this method alone does not have pointer receiver?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't modify the stack

@paulwe paulwe merged commit e05f7b7 into main Feb 23, 2026
11 checks passed
@paulwe paulwe deleted the stack-util branch February 23, 2026 05:55
@github-actions github-actions bot mentioned this pull request Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants