-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Change behavior of String.right #36180
Conversation
It would be good to implement, with both |
^ EDIT: |
26a5dc2
to
ab68ebe
Compare
I have problems rebasing this due to renamed/moved files. Any advice welcome >_> |
I've had a look at trying to rebase your PR and it's going to be difficult. There are over a year's worth of commits that, as you identify, include several files that have been renamed and others that have been completely refactored. Considering the number of lines being changed in this PR vs the number of conflicts, it may be easier to recreate it, or I can reopen #47434. |
ab68ebe
to
2bcad19
Compare
Ok rebased. I manually copied my string changes and then modified other files from scratch. Also updated some tests. |
I accepted the change, but I think it might have been good to keep calls to |
Why though? Right() serves a different purpose now, messing with indicies will only cause confusion. |
Because It's not a big deal anyway but IMHO, it would make the code easier to understand. |
I wonder about this too, but IMO there's a big semantic shift with this PR and the calls to Before the PR, we'd do things like After this PR, to convey the same meaning, If what you suggested was to use |
Needs a rebase, otherwise I think it's good to go. |
2bcad19
to
b185951
Compare
Rebased again. And added some tests again (for negative arguments). |
Thanks! |
Follow-up to #28648
Before:
After:
Basically opposite of
left()
, so is more intuitive and consistent.I replaced all source occurrences of
right
tosubstr()
, which has the same behavior as oldright
. btw,right
was callingsubstr
anyways, so every instance that used it might be few µs faster now 🤔 (heh)