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

Avoid iterating over the source multiple times #936

Merged
merged 1 commit into from Apr 29, 2024

Conversation

jcking
Copy link
Collaborator

@jcking jcking commented Apr 26, 2024

When creating a source, we iterate once to calculate line offsets and then iterate a second time to create the underlying buffer. This change moves the logic to calculate line offsets into the buffer creation. This avoids iterating the source twice and counting code points.

Signed-off-by: Justin King <jcking@google.com>
@jcking jcking merged commit 03048d0 into google:master Apr 29, 2024
2 checks passed
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.

None yet

2 participants