From 6608b3b1789690c768eb4b84eed62e0da3fa3e1c Mon Sep 17 00:00:00 2001 From: David Fowler Date: Mon, 24 Jun 2019 23:50:27 -0700 Subject: [PATCH] Make the platform benchmarks work again (#11537) - Make it compile - Removed a few pubternal usages --- src/Servers/Kestrel/perf/PlatformBenchmarks/AsciiString.cs | 3 +-- .../perf/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs | 3 +-- src/Servers/Kestrel/perf/PlatformBenchmarks/DateHeader.cs | 2 +- src/Servers/Kestrel/perf/PlatformBenchmarks/Program.cs | 1 - 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Servers/Kestrel/perf/PlatformBenchmarks/AsciiString.cs b/src/Servers/Kestrel/perf/PlatformBenchmarks/AsciiString.cs index ef2a32d615..2b16c54e42 100644 --- a/src/Servers/Kestrel/perf/PlatformBenchmarks/AsciiString.cs +++ b/src/Servers/Kestrel/perf/PlatformBenchmarks/AsciiString.cs @@ -3,7 +3,6 @@ using System; using System.Text; -using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; namespace PlatformBenchmarks { @@ -22,7 +21,7 @@ namespace PlatformBenchmarks public static implicit operator AsciiString(string str) => new AsciiString(str); - public override string ToString() => HttpUtilities.GetAsciiStringNonNullCharacters(_data); + public override string ToString() => Encoding.ASCII.GetString(_data); public static explicit operator string(AsciiString str) => str.ToString(); public bool Equals(AsciiString other) => ReferenceEquals(_data, other._data) || SequenceEqual(_data, other._data); diff --git a/src/Servers/Kestrel/perf/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs b/src/Servers/Kestrel/perf/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs index 8f8f78105d..37a45db13b 100644 --- a/src/Servers/Kestrel/perf/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs +++ b/src/Servers/Kestrel/perf/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs @@ -4,8 +4,7 @@ using System; using System.Net; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Configuration; namespace PlatformBenchmarks diff --git a/src/Servers/Kestrel/perf/PlatformBenchmarks/DateHeader.cs b/src/Servers/Kestrel/perf/PlatformBenchmarks/DateHeader.cs index bbc7d7daaa..47415305b2 100644 --- a/src/Servers/Kestrel/perf/PlatformBenchmarks/DateHeader.cs +++ b/src/Servers/Kestrel/perf/PlatformBenchmarks/DateHeader.cs @@ -7,7 +7,7 @@ using System.Diagnostics; using System.Text; using System.Threading; -namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http +namespace PlatformBenchmarks { /// /// Manages the generation of the date header value. diff --git a/src/Servers/Kestrel/perf/PlatformBenchmarks/Program.cs b/src/Servers/Kestrel/perf/PlatformBenchmarks/Program.cs index 6b801e15f3..784af36c2b 100644 --- a/src/Servers/Kestrel/perf/PlatformBenchmarks/Program.cs +++ b/src/Servers/Kestrel/perf/PlatformBenchmarks/Program.cs @@ -4,7 +4,6 @@ using System; using System.Net; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.Extensions.Configuration; namespace PlatformBenchmarks