-
Notifications
You must be signed in to change notification settings - Fork 187
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
Fix bug in str_trunc()
with simpler code
#515
Conversation
Yeah, this fix is cleaner. Looked at speed; they're equivalent. |
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.
Thanks for working on this! Can you please add a bullet to the top of NEWS.md
? It should briefly describe the change and end with (@yourname, #issuenumber)
.
I have updated NEWS.md. Please check it. |
NEWS.md
Outdated
@@ -4,6 +4,9 @@ | |||
|
|||
## Breaking changes | |||
|
|||
* `str_trunc()` now correctly truncates strings when `side` is `"left"` or |
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.
Can you please put this in the news for the development version?
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.
Sorry for the mistake. I just fixed it.
Thanks! |
Fix #512 .
This is a pull request similar to #513 .
#512 is caused by the boundary cases of
stringi::stri_sub()
when getting the end of a string.gagolews/stringi#494
I modified the code to avoid the boundary cases, i.e.,
from
is always a positive number, and added tests.I think this proposal can fix the bug with simpler code than #513 .