Skip to content

Remove unsafe code from number parsing #10397

@danmoseley

Description

@danmoseley

There is heavy use of unsafe code in number.parsing.cs and calling code (eg at

private static unsafe bool TryParseNumber(ref char* str, char* strEnd, NumberStyles styles, ref NumberBuffer number, NumberFormatInfo info)
). This could be rewritten with ReadOnlySpan<char> to eliminate the char * resulting in safer code that is also easier to read.

Relates to dotnet/coreclr#17808

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions