Skip to content

Conversation

@coolreader18
Copy link
Contributor

This eliminates the unsafe code in this module, and also uses less memory (1 machine word per line rather than 2).

I originally thought I could just store the offsets pointing to the end of the line, but then realized that the string returned by get_line() doesn't include the line terminator, so I bitpacked the type of line terminator into the index. If that's too overengineered, I could change it to just trim a trailing cr/lf/crlf off the string, but that might entail extra branching in the happy path.

Copy link
Contributor

@loewenheim loewenheim left a comment

Choose a reason for hiding this comment

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

Hi, thank you for the nice contribution! I just have one stylistic nit.

@loewenheim loewenheim merged commit f96e3d1 into getsentry:master Dec 4, 2025
8 checks passed
@coolreader18 coolreader18 deleted the improve-sourceview branch December 4, 2025 20:22
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.

2 participants