mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Fix CA1510: Use ArgumentNullException throw helper
This commit is contained in:
parent
753660ebcf
commit
53914e06d5
3 changed files with 4 additions and 8 deletions
|
|
@ -64,8 +64,7 @@ internal class ManagedLoadContext : AssemblyLoadContext
|
|||
bool shadowCopyNativeLibraries)
|
||||
: base(Path.GetFileNameWithoutExtension(mainAssemblyPath), isCollectible)
|
||||
{
|
||||
if (resourceProbingPaths == null)
|
||||
throw new ArgumentNullException(nameof(resourceProbingPaths));
|
||||
ArgumentNullException.ThrowIfNull(resourceProbingPaths);
|
||||
|
||||
this.mainAssemblyPath = mainAssemblyPath ?? throw new ArgumentNullException(nameof(mainAssemblyPath));
|
||||
this.dependencyResolver = new AssemblyDependencyResolver(mainAssemblyPath);
|
||||
|
|
|
|||
|
|
@ -53,8 +53,7 @@ internal class PluginLoader : IDisposable
|
|||
/// <returns>A loader.</returns>
|
||||
public static PluginLoader CreateFromAssemblyFile(string assemblyFile, Action<LoaderConfig> configure)
|
||||
{
|
||||
if (configure == null)
|
||||
throw new ArgumentNullException(nameof(configure));
|
||||
ArgumentNullException.ThrowIfNull(configure);
|
||||
|
||||
var config = new LoaderConfig(assemblyFile);
|
||||
configure(config);
|
||||
|
|
|
|||
|
|
@ -115,8 +115,7 @@ internal static class ArrayExtensions
|
|||
if (count < 0 || startIndex > list.Count - count)
|
||||
throw new ArgumentOutOfRangeException(nameof(count), count, null);
|
||||
|
||||
if (match == null)
|
||||
throw new ArgumentNullException(nameof(match));
|
||||
ArgumentNullException.ThrowIfNull(match);
|
||||
|
||||
var endIndex = startIndex + count;
|
||||
for (var i = startIndex; i < endIndex; i++)
|
||||
|
|
@ -138,8 +137,7 @@ internal static class ArrayExtensions
|
|||
/// <inheritdoc cref="List{T}.FindLastIndex(int,int,System.Predicate{T})"/>
|
||||
public static int FindLastIndex<T>(this IReadOnlyList<T> list, int startIndex, int count, Predicate<T> match)
|
||||
{
|
||||
if (match == null)
|
||||
throw new ArgumentNullException(nameof(match));
|
||||
ArgumentNullException.ThrowIfNull(match);
|
||||
|
||||
if (list.Count == 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue