Skip to content

Commit 572a05b

Browse files
Atvaarkamaitland
authored andcommitted
Fix IDE1006 in FindReplaceResponseFilter.cs (#2545)
1 parent 5396f70 commit 572a05b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

CefSharp.Example/Filters/FindReplaceResponseFilter.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ namespace CefSharp.Example.Filters
1111
{
1212
public class FindReplaceResponseFilter : IResponseFilter
1313
{
14-
private static Encoding encoding = Encoding.UTF8;
14+
/// <summary>
15+
/// The character encoding used when writing the replacement string.
16+
/// </summary>
17+
private static readonly Encoding Encoding = Encoding.UTF8;
1518

1619
/// <summary>
1720
/// String to find
@@ -149,7 +152,7 @@ private void WriteString(string str, int stringSize, Stream dataOut, ref long da
149152
// Write the maximum portion that fits in the output buffer.
150153
if (maxWrite > 0)
151154
{
152-
var bytes = encoding.GetBytes(str);
155+
var bytes = Encoding.GetBytes(str);
153156
dataOut.Write(bytes, 0, (int)maxWrite);
154157
dataOutWritten += maxWrite;
155158
}
@@ -158,7 +161,7 @@ private void WriteString(string str, int stringSize, Stream dataOut, ref long da
158161
{
159162
// Need to write more bytes than will fit in the output buffer. Store the
160163
// remainder in the overflow buffer.
161-
overflow.AddRange(encoding.GetBytes(str.Substring((int)maxWrite, (int)(stringSize - maxWrite))));
164+
overflow.AddRange(Encoding.GetBytes(str.Substring((int)maxWrite, (int)(stringSize - maxWrite))));
162165
}
163166
}
164167

0 commit comments

Comments
 (0)