dotnet/runtime

Remove unsafe code from number parsing

Ouverte

#10 397 ouverte le 29 mai 2018

 (11 commentaires) (3 réactions) (0 personne assignée)C# (5 445 forks)batch import
Cost:Marea-System.Numericshelp wantedreduce-unsafe

Métriques du dépôt

Stars
 (17 886 étoiles)
Métriques de merge PR
 (Merge moyen 12j 11h) (661 PRs mergées en 30 j)

Description

There is heavy use of unsafe code in number.parsing.cs and calling code (eg at https://github.com/dotnet/runtime/blob/110282c71b3f7e1f91ea339953f4a0eba362a62c/src/libraries/System.Private.CoreLib/src/System/Number.Parsing.cs#L255). This could be rewritten with ReadOnlySpan<char> to eliminate the char * resulting in safer code that is also easier to read.

Relates to https://github.com/dotnet/coreclr/pull/17808

Guide contributeur