From 572a05bbbff4bf86f79724fcef7c377edbc191ef Mon Sep 17 00:00:00 2001 From: Atvaark Date: Mon, 22 Oct 2018 01:46:28 +0200 Subject: [PATCH] Fix IDE1006 in FindReplaceResponseFilter.cs (#2545) --- CefSharp.Example/Filters/FindReplaceResponseFilter.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CefSharp.Example/Filters/FindReplaceResponseFilter.cs b/CefSharp.Example/Filters/FindReplaceResponseFilter.cs index 0d9910d8c2..b788a7b13f 100644 --- a/CefSharp.Example/Filters/FindReplaceResponseFilter.cs +++ b/CefSharp.Example/Filters/FindReplaceResponseFilter.cs @@ -11,7 +11,10 @@ namespace CefSharp.Example.Filters { public class FindReplaceResponseFilter : IResponseFilter { - private static Encoding encoding = Encoding.UTF8; + /// + /// The character encoding used when writing the replacement string. + /// + private static readonly Encoding Encoding = Encoding.UTF8; /// /// String to find @@ -149,7 +152,7 @@ private void WriteString(string str, int stringSize, Stream dataOut, ref long da // Write the maximum portion that fits in the output buffer. if (maxWrite > 0) { - var bytes = encoding.GetBytes(str); + var bytes = Encoding.GetBytes(str); dataOut.Write(bytes, 0, (int)maxWrite); dataOutWritten += maxWrite; } @@ -158,7 +161,7 @@ private void WriteString(string str, int stringSize, Stream dataOut, ref long da { // Need to write more bytes than will fit in the output buffer. Store the // remainder in the overflow buffer. - overflow.AddRange(encoding.GetBytes(str.Substring((int)maxWrite, (int)(stringSize - maxWrite)))); + overflow.AddRange(Encoding.GetBytes(str.Substring((int)maxWrite, (int)(stringSize - maxWrite)))); } }