Skip to content

[stdlib] Make _parseASCII take radix as Int instead of FixedWidthInteger #26961

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

Closed
wants to merge 1 commit into from
Closed

[stdlib] Make _parseASCII take radix as Int instead of FixedWidthInteger #26961

wants to merge 1 commit into from

Conversation

theblixguy
Copy link
Collaborator

@theblixguy theblixguy commented Aug 30, 2019

Make _parseASCII take the radix parameter as Int instead of Result (aka FixedWidthInteger).

(I've never contributed towards the Standard Library before, so please let me know if you have any feedback!)

Resolves SR-11397.

) -> Result?
where CodeUnits.Element: UnsignedInteger {
let c0_ = codeUnits.next()
guard _fastPath(c0_ != nil), let c0 = c0_ else { return nil }
if _fastPath(c0 != _ascii16("+") && c0 != _ascii16("-")) {
return _parseUnsignedASCII(
first: c0, rest: &codeUnits, radix: radix, positive: true)
first: c0, rest: &codeUnits, radix: radix, positive: true) as? Result
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a clear indication that this is not a full solution; _parseUnsignedASCII should still be returning a Result, so this cast shouldn't be necessary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theblixguy Looks to me like you'll need to propagate the radix: Result -> radix: Int change throughout all the internal methods in this file.

@shahmishal
Copy link
Member

Please update the base branch to main by Oct 5th otherwise the pull request will be closed automatically.

  • How to change the base branch: (Link)
  • More detail about the branch update: (Link)

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants