From 4899155237a3ac802391d28a45671738e0084de9 Mon Sep 17 00:00:00 2001 From: Burak Akgerman Date: Wed, 1 Jun 2022 18:29:00 -0400 Subject: [PATCH] Fix 3 code smells --- .../LayoutRenderers/AspNetLayoutMultiValueRendererBase.cs | 6 +++--- .../LayoutRenderers/AspNetRequestLocalPortLayoutRenderer.cs | 2 +- .../AspNetRequestRemotePortLayoutRenderer.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Shared/LayoutRenderers/AspNetLayoutMultiValueRendererBase.cs b/src/Shared/LayoutRenderers/AspNetLayoutMultiValueRendererBase.cs index 59efdb70..160ceefa 100644 --- a/src/Shared/LayoutRenderers/AspNetLayoutMultiValueRendererBase.cs +++ b/src/Shared/LayoutRenderers/AspNetLayoutMultiValueRendererBase.cs @@ -52,7 +52,7 @@ public bool SingleAsArray /// public bool ValuesOnly { get; set; } -#region Pairs + #region Pairs /// /// Serialize multiple key/value pairs /// @@ -170,7 +170,7 @@ private void SerializePairsFlat(IEnumerable> pairs, #endregion - + #region Singles /// @@ -215,7 +215,7 @@ private void SerializeSinglesJson(IEnumerable values, StringBuilder buil } } - private void SerializeSingleJson(StringBuilder builder, string value) + private static void SerializeSingleJson(StringBuilder builder, string value) { // Quoted value AppendQuoted(builder, value); diff --git a/src/Shared/LayoutRenderers/AspNetRequestLocalPortLayoutRenderer.cs b/src/Shared/LayoutRenderers/AspNetRequestLocalPortLayoutRenderer.cs index fbc7d568..e1103bf2 100644 --- a/src/Shared/LayoutRenderers/AspNetRequestLocalPortLayoutRenderer.cs +++ b/src/Shared/LayoutRenderers/AspNetRequestLocalPortLayoutRenderer.cs @@ -31,7 +31,7 @@ protected override void DoAppend(StringBuilder builder, LogEventInfo logEvent) return; } - builder.Append(connection.LocalPort.ToString()); + builder.Append(connection.LocalPort); #else var request = httpContext.TryGetRequest(); if (request == null) diff --git a/src/Shared/LayoutRenderers/AspNetRequestRemotePortLayoutRenderer.cs b/src/Shared/LayoutRenderers/AspNetRequestRemotePortLayoutRenderer.cs index 9152274b..e2478a47 100644 --- a/src/Shared/LayoutRenderers/AspNetRequestRemotePortLayoutRenderer.cs +++ b/src/Shared/LayoutRenderers/AspNetRequestRemotePortLayoutRenderer.cs @@ -32,7 +32,7 @@ protected override void DoAppend(StringBuilder builder, LogEventInfo logEvent) return; } - builder.Append(connection.RemotePort.ToString()); + builder.Append(connection.RemotePort); #else var request = httpContext.TryGetRequest(); if (request == null)