mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-14 20:54:16 +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)
|
bool shadowCopyNativeLibraries)
|
||||||
: base(Path.GetFileNameWithoutExtension(mainAssemblyPath), isCollectible)
|
: base(Path.GetFileNameWithoutExtension(mainAssemblyPath), isCollectible)
|
||||||
{
|
{
|
||||||
if (resourceProbingPaths == null)
|
ArgumentNullException.ThrowIfNull(resourceProbingPaths);
|
||||||
throw new ArgumentNullException(nameof(resourceProbingPaths));
|
|
||||||
|
|
||||||
this.mainAssemblyPath = mainAssemblyPath ?? throw new ArgumentNullException(nameof(mainAssemblyPath));
|
this.mainAssemblyPath = mainAssemblyPath ?? throw new ArgumentNullException(nameof(mainAssemblyPath));
|
||||||
this.dependencyResolver = new AssemblyDependencyResolver(mainAssemblyPath);
|
this.dependencyResolver = new AssemblyDependencyResolver(mainAssemblyPath);
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,7 @@ internal class PluginLoader : IDisposable
|
||||||
/// <returns>A loader.</returns>
|
/// <returns>A loader.</returns>
|
||||||
public static PluginLoader CreateFromAssemblyFile(string assemblyFile, Action<LoaderConfig> configure)
|
public static PluginLoader CreateFromAssemblyFile(string assemblyFile, Action<LoaderConfig> configure)
|
||||||
{
|
{
|
||||||
if (configure == null)
|
ArgumentNullException.ThrowIfNull(configure);
|
||||||
throw new ArgumentNullException(nameof(configure));
|
|
||||||
|
|
||||||
var config = new LoaderConfig(assemblyFile);
|
var config = new LoaderConfig(assemblyFile);
|
||||||
configure(config);
|
configure(config);
|
||||||
|
|
|
||||||
|
|
@ -115,8 +115,7 @@ internal static class ArrayExtensions
|
||||||
if (count < 0 || startIndex > list.Count - count)
|
if (count < 0 || startIndex > list.Count - count)
|
||||||
throw new ArgumentOutOfRangeException(nameof(count), count, null);
|
throw new ArgumentOutOfRangeException(nameof(count), count, null);
|
||||||
|
|
||||||
if (match == null)
|
ArgumentNullException.ThrowIfNull(match);
|
||||||
throw new ArgumentNullException(nameof(match));
|
|
||||||
|
|
||||||
var endIndex = startIndex + count;
|
var endIndex = startIndex + count;
|
||||||
for (var i = startIndex; i < endIndex; i++)
|
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})"/>
|
/// <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)
|
public static int FindLastIndex<T>(this IReadOnlyList<T> list, int startIndex, int count, Predicate<T> match)
|
||||||
{
|
{
|
||||||
if (match == null)
|
ArgumentNullException.ThrowIfNull(match);
|
||||||
throw new ArgumentNullException(nameof(match));
|
|
||||||
|
|
||||||
if (list.Count == 0)
|
if (list.Count == 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue