mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-22 07:43:01 +00:00
Don't compare strings to Empty using Equals
Comparing strings using the String.Length property or the String.IsNullOrEmpty method is faster than using Equals. This is because Equals executes significantly more MSIL instructions than either IsNullOrEmpty or the number of instructions executed to retrieve the Length property value and compare it to zero.
This commit is contained in:
parent
08ee2f7e32
commit
b2c2c79a96
2 changed files with 1 additions and 2 deletions
|
@ -191,7 +191,6 @@ dotnet_diagnostic.CA1814.severity = suggestion
|
|||
dotnet_diagnostic.CA1815.severity = suggestion
|
||||
dotnet_diagnostic.CA1816.severity = suggestion
|
||||
dotnet_diagnostic.CA1819.severity = suggestion
|
||||
dotnet_diagnostic.CA1820.severity = suggestion
|
||||
dotnet_diagnostic.CA1822.severity = suggestion
|
||||
dotnet_diagnostic.CA1823.severity = suggestion
|
||||
dotnet_diagnostic.CA1824.severity = suggestion
|
||||
|
|
|
@ -239,7 +239,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
|
|||
xmlResult += "https://www.thetvdb.com/?tab=series&id=" + series.TvdbId;
|
||||
}
|
||||
|
||||
return xmlResult == string.Empty ? null : new MetadataFileResult("tvshow.nfo", xmlResult);
|
||||
return xmlResult.IsNullOrWhiteSpace() ? null : new MetadataFileResult("tvshow.nfo", xmlResult);
|
||||
}
|
||||
|
||||
public override MetadataFileResult EpisodeMetadata(Series series, EpisodeFile episodeFile)
|
||||
|
|
Loading…
Reference in a new issue