Skip to content

Add Length() function to collection values #1187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ChihweiLHBird
Copy link

@ChihweiLHBird ChihweiLHBird commented Jul 16, 2025

Related Issue

Fixes #1067

Description

Implement Length() functions for collection values, so users can avoid len(list.Elements()) which is less clean and efficient because Elements() allocate a new block of memory for returning a new slice.

If you guys prefer Size() or another naming, let me know and I can change it.

@ChihweiLHBird ChihweiLHBird requested a review from a team as a code owner July 16, 2025 07:54
@ChihweiLHBird ChihweiLHBird changed the title Add Length() function to all collection types Add Length() function to collection types Jul 16, 2025
@ChihweiLHBird ChihweiLHBird changed the title Add Length() function to collection types Add Length() function to collection values Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Length() Function for Collection Types
1 participant