Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spellcheck: Use direct buffer access instead of deprecated API
- Loading branch information
Showing
1 changed file
with
9 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2c48166
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a fair bit faster as the word is only even fetched only if its length would match the clickpos one's, in case the
strcmp()
would have failed anyway. And as we know the length, we can usestrncmp()
and then any pointer (without necessarily a trailing\0
).Also, the gap is not very likely to be in the middle of a word, so unlikely to have to move. And anyway, would move at worse once.