Skip to content

Fix bug in range and position caching#1127

Merged
TwitchBronBron merged 8 commits into
release-1.0.0from
TBD-214
Apr 1, 2024
Merged

Fix bug in range and position caching#1127
TwitchBronBron merged 8 commits into
release-1.0.0from
TBD-214

Conversation

@fumer-fubotv

@fumer-fubotv fumer-fubotv commented Mar 29, 2024

Copy link
Copy Markdown
Collaborator

@fumer-fubotv fumer-fubotv self-assigned this Mar 29, 2024
Comment thread src/util.ts Outdated

// eslint-disable-next-line no-bitwise
const key = (startLine << 52) + (startCharacter << 39) + (endLine << 26) + (endCharacter << 13);
const key = (endCharacter << 24) + (endLine << 16) + (startLine << 8) + startCharacter;

@TwitchBronBron TwitchBronBron Mar 30, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Using 8 bits per number only gives us a max of 255 lines in a file or 255 characters in a line before this key overflows. That's far too small.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

updated

@TwitchBronBron
TwitchBronBron merged commit fa4f048 into release-1.0.0 Apr 1, 2024
@TwitchBronBron
TwitchBronBron deleted the TBD-214 branch April 1, 2024 17: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.

2 participants