dotnet/runtime

Remove unsafe code from number parsing

Open

#10,397 创建于 2018年5月29日

在 GitHub 查看
 (11 评论) (3 反应) (0 负责人)C# (5,445 fork)batch import
Cost:Marea-System.Numericshelp wantedreduce-unsafe

仓库指标

Star
 (17,886 star)
PR 合并指标
 (平均合并 12天 11小时) (30 天内合并 661 个 PR)

描述

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

贡献者指南