This commit removes several unnecessary char-related allocations in System.IO.FileSystem. Most of them stemmed from appending the DirectorySeparatorChar to a string, which results in the compiler using String.Concat(..., object) for the concatenation, which means the char gets boxed. Others stemmed from array allocations that could have been cached, e.g. allocating an array for the directory separator chars on each call to TrimEnd.
In fixing these, I also noticed and fixed a few places where duplicated logic could be replaced with a call to IsDirectoryChar.
Commit migrated from https://github.com/dotnet/corefx/commit/b5d327ac0ad50488c801b716b69521be6a6720c9
The System.Runtime.Serialization namespace isn't defined in any of the
NuGet packages and is not used in the project, so it can be removed.
The System.IO.FileSystem tests were missing a reference to
System.Runtime.Handles in packages.config (SafeHandle is defined there).
This fixes compilation errors on the Mono compiler.
Commit migrated from https://github.com/dotnet/corefx/commit/11f161176d4b1823f47d35d651a027a892f4e1ad
When System.IO.FileSystem was added to the repo, changes made to SafeFileHandle did not migrate with it. There was also a file reference missing from the .csproj file. Both of these broke the Unix build. This change just brings those back in sync.
Commit migrated from https://github.com/dotnet/corefx/commit/49ea84c45b466d90ef4490a49976ea7b498287a0
TaskHelpers.cs is a temporary stop-gap for assemblies that don't yet depend on the latest System.Threading.Tasks contract. This change removes the dependency for those assemblies that do, changing them to use the Task.CompletedTask, Task.FromCanceled, and Task.FromException members on Task instead of the corresponding workarounds on TaskHelpers. This file should eventually go away entirely.
Commit migrated from https://github.com/dotnet/corefx/commit/325e24de73b86c2b1f920109afe06faedb42b3d8