-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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] Fix chr impl taking funcs to string_slice and separating #3506
Conversation
Signed-off-by: martinvuyk <martin.vuyklop@gmail.com>
return int((sizes < c).cast[DType.uint8]().reduce_add()) | ||
|
||
|
||
fn _shift_unicode_to_utf8(ptr: UnsafePointer[UInt8], c: Int, num_bytes: Int): |
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.
I'm not sure of this argument ordering but I don't know if we have any such sort of convention yet
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.
There's no convention yet, I could make a case either way: weak preference towards putting num_bytes
as the second argument.
return int((sizes < c).cast[DType.uint8]().reduce_add()) | ||
|
||
|
||
fn _shift_unicode_to_utf8(ptr: UnsafePointer[UInt8], c: Int, num_bytes: Int): |
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.
There's no convention yet, I could make a case either way: weak preference towards putting num_bytes
as the second argument.
!sync |
✅🟣 This contribution has been merged 🟣✅ Your pull request has been merged to the internal upstream Mojo sources. It will be reflected here in the Mojo repository on the nightly branch during the next Mojo nightly release, typically within the next 24-48 hours. We use Copybara to merge external contributions, click here to learn more. |
…arating (#47532) [External] [stdlib] Fix chr impl taking funcs to string_slice and separating Fix `chr` implementation taking funcs to `string_slice` and separating their respective functionalities. This code will be used elsewhere e.g., PR [#3496](#3496 (comment)) ORIGINAL_AUTHOR=martinvuyk <110240700+martinvuyk@users.noreply.github.com> PUBLIC_PR_LINK=#3506 Co-authored-by: martinvuyk <110240700+martinvuyk@users.noreply.github.com> Closes #3506 MODULAR_ORIG_COMMIT_REV_ID: dc8c96e58f5e272d01e3c26f6daf3ffe8f7c0b36
Landed in 38ed691! Thank you for your contribution 🎉 |
Fix chr implementation taking funcs to string_slice and separating their respective functionalities.
This code will be used elsewhere e.g., PR #3496