Skip to content

Commit

Permalink
Fix IDE1006 in FindReplaceResponseFilter.cs (#2545)
Browse files Browse the repository at this point in the history
  • Loading branch information
Atvaark authored and amaitland committed Oct 21, 2018
1 parent 5396f70 commit 572a05b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions CefSharp.Example/Filters/FindReplaceResponseFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ namespace CefSharp.Example.Filters
{
public class FindReplaceResponseFilter : IResponseFilter
{
private static Encoding encoding = Encoding.UTF8;
/// <summary>
/// The character encoding used when writing the replacement string.
/// </summary>
private static readonly Encoding Encoding = Encoding.UTF8;

/// <summary>
/// String to find
Expand Down Expand Up @@ -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;
}
Expand All @@ -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))));
}
}

Expand Down

0 comments on commit 572a05b

Please sign in to comment.