mirror of https://github.com/Radarr/Radarr
Fixed: Use Append(Char) for single character Stringbuilder additions
This commit is contained in:
parent
1740ad337c
commit
088ffc34df
|
@ -195,7 +195,6 @@ dotnet_diagnostic.CA1826.severity = suggestion
|
|||
dotnet_diagnostic.CA1827.severity = suggestion
|
||||
dotnet_diagnostic.CA1828.severity = suggestion
|
||||
dotnet_diagnostic.CA1829.severity = suggestion
|
||||
dotnet_diagnostic.CA1834.severity = suggestion
|
||||
dotnet_diagnostic.CA2000.severity = suggestion
|
||||
dotnet_diagnostic.CA2002.severity = suggestion
|
||||
dotnet_diagnostic.CA2007.severity = suggestion
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace NzbDrone.Common.Http
|
|||
if (scheme.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
builder.Append(scheme);
|
||||
builder.Append(":");
|
||||
builder.Append(':');
|
||||
}
|
||||
|
||||
if (host.IsNotNullOrWhiteSpace())
|
||||
|
@ -36,7 +36,7 @@ namespace NzbDrone.Common.Http
|
|||
builder.Append(host);
|
||||
if (port.HasValue)
|
||||
{
|
||||
builder.Append(":");
|
||||
builder.Append(':');
|
||||
builder.Append(port);
|
||||
}
|
||||
}
|
||||
|
@ -200,11 +200,11 @@ namespace NzbDrone.Common.Http
|
|||
{
|
||||
if (builder.Length != 0)
|
||||
{
|
||||
builder.Append("&");
|
||||
builder.Append('&');
|
||||
}
|
||||
|
||||
builder.Append(Uri.EscapeDataString(pair.Key));
|
||||
builder.Append("=");
|
||||
builder.Append('=');
|
||||
builder.Append(Uri.EscapeDataString(pair.Value));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
|
@ -46,7 +46,7 @@ namespace NzbDrone.Core.Datastore
|
|||
|
||||
protected override Expression VisitBinary(BinaryExpression expression)
|
||||
{
|
||||
_sb.Append("(");
|
||||
_sb.Append('(');
|
||||
|
||||
Visit(expression.Left);
|
||||
|
||||
|
@ -54,7 +54,7 @@ namespace NzbDrone.Core.Datastore
|
|||
|
||||
Visit(expression.Right);
|
||||
|
||||
_sb.Append(")");
|
||||
_sb.Append(')');
|
||||
|
||||
return expression;
|
||||
}
|
||||
|
@ -309,7 +309,7 @@ namespace NzbDrone.Core.Datastore
|
|||
item = body.Arguments[1];
|
||||
}
|
||||
|
||||
_sb.Append("(");
|
||||
_sb.Append('(');
|
||||
|
||||
Visit(item);
|
||||
|
||||
|
@ -319,9 +319,9 @@ namespace NzbDrone.Core.Datastore
|
|||
if (item.Type == typeof(int) && TryGetRightValue(list, out var value))
|
||||
{
|
||||
var items = (IEnumerable<int>)value;
|
||||
_sb.Append("(");
|
||||
_sb.Append('(');
|
||||
_sb.Append(string.Join(", ", items));
|
||||
_sb.Append(")");
|
||||
_sb.Append(')');
|
||||
|
||||
_gotConcreteValue = true;
|
||||
}
|
||||
|
@ -330,12 +330,12 @@ namespace NzbDrone.Core.Datastore
|
|||
Visit(list);
|
||||
}
|
||||
|
||||
_sb.Append(")");
|
||||
_sb.Append(')');
|
||||
}
|
||||
|
||||
private void ParseStringContains(MethodCallExpression body)
|
||||
{
|
||||
_sb.Append("(");
|
||||
_sb.Append('(');
|
||||
|
||||
Visit(body.Object);
|
||||
|
||||
|
@ -348,7 +348,7 @@ namespace NzbDrone.Core.Datastore
|
|||
|
||||
private void ParseStartsWith(MethodCallExpression body)
|
||||
{
|
||||
_sb.Append("(");
|
||||
_sb.Append('(');
|
||||
|
||||
Visit(body.Object);
|
||||
|
||||
|
@ -361,7 +361,7 @@ namespace NzbDrone.Core.Datastore
|
|||
|
||||
private void ParseEndsWith(MethodCallExpression body)
|
||||
{
|
||||
_sb.Append("(");
|
||||
_sb.Append('(');
|
||||
|
||||
Visit(body.Object);
|
||||
|
||||
|
@ -369,7 +369,7 @@ namespace NzbDrone.Core.Datastore
|
|||
|
||||
Visit(body.Arguments[0]);
|
||||
|
||||
_sb.Append(")");
|
||||
_sb.Append(')');
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
|
|
@ -115,13 +115,13 @@ namespace NzbDrone.Core.Extras.Subtitles
|
|||
|
||||
if (multipleCopies)
|
||||
{
|
||||
suffixBuilder.Append(".");
|
||||
suffixBuilder.Append('.');
|
||||
suffixBuilder.Append(copy);
|
||||
}
|
||||
|
||||
if (language != Language.Unknown)
|
||||
{
|
||||
suffixBuilder.Append(".");
|
||||
suffixBuilder.Append('.');
|
||||
suffixBuilder.Append(IsoLanguages.Get(language).TwoLetterCode);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
@ -162,8 +162,8 @@ namespace TinyTwitter
|
|||
private string GenerateSignature(IEnumerable<KeyValuePair<string, string>> parameters)
|
||||
{
|
||||
var dataToSign = new StringBuilder()
|
||||
.Append(_method).Append("&")
|
||||
.Append(_url.EncodeRFC3986()).Append("&")
|
||||
.Append(_method).Append('&')
|
||||
.Append(_url.EncodeRFC3986()).Append('&')
|
||||
.Append(parameters
|
||||
.OrderBy(x => x.Key)
|
||||
.Select(x => string.Format("{0}={1}", x.Key, x.Value))
|
||||
|
|
Loading…
Reference in New Issue