Replace TryCopyTo with CopyTo (dotnet/coreclr#16078)
authorStephen Toub <stoub@microsoft.com>
Tue, 30 Jan 2018 15:17:30 +0000 (10:17 -0500)
committerGitHub <noreply@github.com>
Tue, 30 Jan 2018 15:17:30 +0000 (10:17 -0500)
commitbe4ca7a24096e6a3374cdfebf327acd3f6500326
tree005c0e1def0743c6f8add0d280ee3c1eba557833
parent57d92b4d2716d39d899ffc930bc43ad35514634a
Replace TryCopyTo with CopyTo (dotnet/coreclr#16078)

While doing various Span-related work involving copying, in a few places I previously used a pattern of calling TryCopyTo and then asserting its result, in places where I knew the destination was long enough.  This was because CopyTo was implemented as a wrapper around TryCopyTo and thus involved an extra unnecessary branch.  Now that that's no longer the case, I'm simplifying the call sites.

Commit migrated from https://github.com/dotnet/coreclr/commit/efebb38f3c18425c57f94ff910a50e038d13c848
src/coreclr/src/mscorlib/shared/System/Boolean.cs
src/coreclr/src/mscorlib/shared/System/Number.Formatting.cs
src/coreclr/src/mscorlib/shared/System/Text/ValueStringBuilder.cs