From e6ab0107580f2e32d022dbbe2201e2ad6dfdb1d2 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Wed, 12 Sep 2018 08:12:53 -0700 Subject: Revert changes that are causing buildbreaks of OOB packages Signed-off-by: dotnet-bot --- .../shared/System/Diagnostics/Tracing/TraceLogging/Statics.cs | 2 +- src/System.Private.CoreLib/shared/System/IO/PathHelper.Windows.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/TraceLogging/Statics.cs b/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/TraceLogging/Statics.cs index 3dc788350..0c2167213 100644 --- a/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/TraceLogging/Statics.cs +++ b/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/TraceLogging/Statics.cs @@ -174,7 +174,7 @@ namespace System.Diagnostics.Tracing public static void CheckName(string name) { - if (name != null && name.Contains('\0')) + if (name != null && 0 <= name.IndexOf('\0')) { throw new ArgumentOutOfRangeException(nameof(name)); } diff --git a/src/System.Private.CoreLib/shared/System/IO/PathHelper.Windows.cs b/src/System.Private.CoreLib/shared/System/IO/PathHelper.Windows.cs index f9a649590..bada2f5cd 100644 --- a/src/System.Private.CoreLib/shared/System/IO/PathHelper.Windows.cs +++ b/src/System.Private.CoreLib/shared/System/IO/PathHelper.Windows.cs @@ -33,7 +33,7 @@ namespace System.IO // If we have the exact same string we were passed in, don't allocate another string. // TryExpandShortName does this input identity check. - string result = builder.AsSpan().Contains('~') + string result = builder.AsSpan().IndexOf('~') >= 0 ? TryExpandShortFileName(ref builder, originalPath: path) : builder.AsSpan().Equals(path.AsSpan(), StringComparison.Ordinal) ? path : builder.ToString(); @@ -56,7 +56,7 @@ namespace System.IO // Get the full path GetFullPathName(path.AsSpan(terminate: true), ref builder); - string result = builder.AsSpan().Contains('~') + string result = builder.AsSpan().IndexOf('~') >= 0 ? TryExpandShortFileName(ref builder, originalPath: null) : builder.ToString(); -- cgit v1.2.3