-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[stdlib] Optional start
and length
arg for String._strref_dangerous
#2719
base: nightly
Are you sure you want to change the base?
Conversation
Signed-off-by: Lukas Lipp <llipp@cg.tuwien.ac.at>
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 the patch! @JoeLoser Do you have thoughts on this?
Co-authored-by: Laszlo Kindrat <laszlokindrat@gmail.com> Signed-off-by: Lukas Lipp <15105596+fknfilewalker@users.noreply.github.com>
Signed-off-by: Lukas Lipp <15105596+fknfilewalker@users.noreply.github.com>
Signed-off-by: Lukas Lipp <llipp@cg.tuwien.ac.at>
Signed-off-by: Lukas Lipp <llipp@cg.tuwien.ac.at>
Signed-off-by: Lukas Lipp <llipp@cg.tuwien.ac.at>
Signed-off-by: Lukas Lipp <15105596+fknfilewalker@users.noreply.github.com>
Signed-off-by: Lukas Lipp <15105596+fknfilewalker@users.noreply.github.com>
In general, use of |
Yeah, although I think this could be useful in the meanwhile, and low risk since it's a hidden API anyway. @fknfilewalker Could you please rebase after the next nightly, and change this patch to update the potential uses in |
Signed-off-by: Lukas Lipp <15105596+fknfilewalker@users.noreply.github.com>
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.
Thank you! I have a few more requests, but LGTM otherwise!
Signed-off-by: Lukas Lipp <15105596+fknfilewalker@users.noreply.github.com>
Signed-off-by: Lukas Lipp <llipp@cg.tuwien.ac.at>
Signed-off-by: Lukas Lipp <llipp@cg.tuwien.ac.at>
Also, can you please update |
For now I only checked string.mojo and there are not many places where it is really helpful and since you want to replace it with |
Is it really only one place where it's useful? I would have expected more. If you find one or two more places, I think we should land it, otherwise you're probably right, it's not pulling its weight. |
Normally when one wants to create a truncated StringRef, a ptr to the String together with offsets need to be used. This is annoying and dangerous and could be done more safely during the
_strref_dangerous
call. This also adds bound guards