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 use strncmp()
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.
—
Reply to this email directly or view it on GitHub.