Skip to content
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

Use length instead of subscript operator #24

Merged
merged 1 commit into from
Apr 23, 2024
Merged

Conversation

heifner
Copy link
Member

@heifner heifner commented Apr 23, 2024

Cleanup use of span constructor. Use span constructor that takes a begin iterator and length instead of begin/end. The subscript operator call is not needed, these are all fixed sized spans that can be created with a hard-coded length. Also I think it makes the code easier to read and easier to verify correctness.

Copy link
Member

@linh2931 linh2931 left a comment

Choose a reason for hiding this comment

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

I am wondering if it is worthy the effort to make those hardcoded numbers as constants.

@heifner
Copy link
Member Author

heifner commented Apr 23, 2024

I am wondering if it is worthy the effort to make those hardcoded numbers as constants.

Would require a lot of changes for what I think is little to no benefit.

@heifner heifner merged commit 6b718d1 into main Apr 23, 2024
9 checks passed
@heifner heifner deleted the span-subscript-operator branch April 23, 2024 23:41
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.

4 participants