Fixed: Test for empty strings using isNullOrEmpty

pull/2/head
Qstick 4 years ago
parent 4ec71538b9
commit 7d31eb1f55

@ -185,8 +185,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.CA1821.severity = suggestion
dotnet_diagnostic.CA1822.severity = suggestion
dotnet_diagnostic.CA1823.severity = suggestion
dotnet_diagnostic.CA1824.severity = suggestion

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
@ -488,7 +488,7 @@ namespace NzbDrone.Common.OAuth
private static bool IsNullOrBlank(string value)
{
return string.IsNullOrEmpty(value) || (!string.IsNullOrEmpty(value) && value.Trim() == string.Empty);
return string.IsNullOrEmpty(value) || (!string.IsNullOrEmpty(value) && string.IsNullOrEmpty(value.Trim()));
}
}
}

@ -405,7 +405,7 @@ namespace NzbDrone.Common.OAuth
private static bool IsNullOrBlank(string value)
{
return string.IsNullOrEmpty(value) || (!string.IsNullOrEmpty(value) && value.Trim() == string.Empty);
return string.IsNullOrEmpty(value) || (!string.IsNullOrEmpty(value) && string.IsNullOrEmpty(value.Trim()));
}
}
}

@ -3660,7 +3660,7 @@ namespace TinyIoC
var registrations = _RegisteredTypes.Keys.Where(tr => tr.Type == resolveType).Concat(GetParentRegistrationsForType(resolveType));
if (!includeUnnamed)
registrations = registrations.Where(tr => tr.Name != string.Empty);
registrations = registrations.Where(tr => !string.IsNullOrEmpty(tr.Name));
return registrations.Select(registration => this.ResolveInternal(registration, NamedParameterOverloads.Default, ResolveOptions.Default));
}

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text.RegularExpressions;
@ -40,7 +40,7 @@ namespace NzbDrone.Core.Datastore.Migration
modifiers += "RQ";
}
if (modifiers != "")
if (!string.IsNullOrEmpty(modifiers))
{
modifiers = "_" + modifiers;
}

@ -305,7 +305,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
var metadataFileName = GetMovieMetadataFilename(movieFile.RelativePath);
return xmlResult == string.Empty ? null : new MetadataFileResult(metadataFileName, xmlResult.Trim(Environment.NewLine.ToCharArray()));
return string.IsNullOrEmpty(xmlResult) ? null : new MetadataFileResult(metadataFileName, xmlResult.Trim(Environment.NewLine.ToCharArray()));
}
public override List<ImageFileResult> MovieImages(Movie movie)

@ -348,7 +348,7 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
return ""; // Other
}
if (videoCodecLibrary == "")
if (string.IsNullOrEmpty(videoCodecLibrary))
{
return ""; // Unknown mp4v
}

@ -48,7 +48,7 @@ namespace NzbDrone.Core.Parser
if (isoArray.Length > 1)
{
isoLanguages = isoLanguages.Any(l => l.CountryCode == isoArray[1].ToLower()) ?
isoLanguages.Where(l => l.CountryCode == isoArray[1].ToLower()).ToList() : isoLanguages.Where(l => l.CountryCode == "").ToList();
isoLanguages.Where(l => l.CountryCode == isoArray[1].ToLower()).ToList() : isoLanguages.Where(l => string.IsNullOrEmpty(l.CountryCode)).ToList();
}
return isoLanguages.FirstOrDefault();

@ -55,7 +55,7 @@ namespace NzbDrone.Mono.Disk
var target = 0;
for (var i = 0; i < dirs.Length; ++i)
{
if (dirs[i] == "." || dirs[i] == string.Empty)
if (dirs[i] == "." || string.IsNullOrEmpty(dirs[i]))
{
continue;
}

Loading…
Cancel
Save