From 6ca0024db95caa50c43cac85333ef18dc77efff5 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Thu, 23 Jul 2020 18:19:15 +0100 Subject: [PATCH] Fix SA1026CodeMustNotContainSpaceAfterNewKeywordInImplicitlyTypedArrayAllocation (#13249) See https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1026.md --- src/System.Management.Automation/utils/CryptoUtils.cs | 2 +- test/tools/WebListener/DeflateFilter.cs | 2 +- test/tools/WebListener/GzipFilter.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/System.Management.Automation/utils/CryptoUtils.cs b/src/System.Management.Automation/utils/CryptoUtils.cs index f860bdd4b1..4b747eeab8 100644 --- a/src/System.Management.Automation/utils/CryptoUtils.cs +++ b/src/System.Management.Automation/utils/CryptoUtils.cs @@ -74,7 +74,7 @@ namespace System.Management.Automation.Internal private static byte[] GetBytesLE(int val) { - return new [] { + return new[] { (byte)(val & 0xff), (byte)((val >> 8) & 0xff), (byte)((val >> 16) & 0xff), diff --git a/test/tools/WebListener/DeflateFilter.cs b/test/tools/WebListener/DeflateFilter.cs index b7af0befd4..46cf30d36d 100644 --- a/test/tools/WebListener/DeflateFilter.cs +++ b/test/tools/WebListener/DeflateFilter.cs @@ -22,7 +22,7 @@ namespace mvc.Controllers using (var compressedStream = new DeflateStream(responseStream, CompressionLevel.Fastest)) { - httpContext.Response.Headers.Add("Content-Encoding", new [] { "deflate" }); + httpContext.Response.Headers.Add("Content-Encoding", new[] { "deflate" }); memoryStream.Seek(0, SeekOrigin.Begin); await memoryStream.CopyToAsync(compressedStream); } diff --git a/test/tools/WebListener/GzipFilter.cs b/test/tools/WebListener/GzipFilter.cs index 58bca478b0..c908ee08f0 100644 --- a/test/tools/WebListener/GzipFilter.cs +++ b/test/tools/WebListener/GzipFilter.cs @@ -22,7 +22,7 @@ namespace mvc.Controllers using (var compressedStream = new GZipStream(responseStream, CompressionLevel.Fastest)) { - httpContext.Response.Headers.Add("Content-Encoding", new [] { "gzip" }); + httpContext.Response.Headers.Add("Content-Encoding", new[] { "gzip" }); memoryStream.Seek(0, SeekOrigin.Begin); await memoryStream.CopyToAsync(compressedStream); }