dotnet/runtime

Remove unsafe code from number parsing

開放

#10,397 建立於 2018年5月29日

 (11 則留言) (3 個反應) (0 位負責人)C# (5,445 個分叉)batch import
Cost:Marea-System.Numericshelp wantedreduce-unsafe

倉庫指標

星標
 (17,886 顆星)
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

貢獻者指南