Enable Net 7 and Net 8 style rules.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
71ae0aedfb
commit
cfde11556f
@@ -23,8 +23,7 @@ namespace OpenRA.Primitives
|
||||
|
||||
public void Add(Action a, long desiredTime)
|
||||
{
|
||||
if (a == null)
|
||||
throw new ArgumentNullException(nameof(a));
|
||||
ArgumentNullException.ThrowIfNull(a);
|
||||
|
||||
lock (actions)
|
||||
{
|
||||
|
||||
@@ -21,8 +21,7 @@ namespace OpenRA
|
||||
|
||||
public ActorInfoDictionary(IReadOnlyDictionary<string, ActorInfo> dict)
|
||||
{
|
||||
if (dict == null)
|
||||
throw new ArgumentNullException(nameof(dict));
|
||||
ArgumentNullException.ThrowIfNull(dict);
|
||||
|
||||
this.dict = new Dictionary<string, ActorInfo>(dict);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,7 @@ namespace OpenRA.Primitives
|
||||
|
||||
public Cache(Func<T, U> loader, IEqualityComparer<T> c)
|
||||
{
|
||||
if (loader == null)
|
||||
throw new ArgumentNullException(nameof(loader));
|
||||
ArgumentNullException.ThrowIfNull(loader);
|
||||
|
||||
this.loader = loader;
|
||||
cache = new Dictionary<T, U>(c);
|
||||
|
||||
@@ -22,8 +22,7 @@ namespace OpenRA.Primitives
|
||||
|
||||
public ConcurrentCache(Func<T, U> loader, IEqualityComparer<T> c)
|
||||
{
|
||||
if (loader == null)
|
||||
throw new ArgumentNullException(nameof(loader));
|
||||
ArgumentNullException.ThrowIfNull(loader);
|
||||
|
||||
this.loader = loader;
|
||||
cache = new ConcurrentDictionary<T, U>(c);
|
||||
|
||||
@@ -27,8 +27,7 @@ namespace OpenRA.Primitives
|
||||
|
||||
protected ReadOnlyAdapterStream(Stream stream)
|
||||
{
|
||||
if (stream == null)
|
||||
throw new ArgumentNullException(nameof(stream));
|
||||
ArgumentNullException.ThrowIfNull(stream);
|
||||
if (!stream.CanRead)
|
||||
throw new ArgumentException("stream must be readable.", nameof(stream));
|
||||
|
||||
|
||||
@@ -65,8 +65,7 @@ namespace OpenRA.Primitives
|
||||
|
||||
public void CopyTo(T[] array, int arrayIndex)
|
||||
{
|
||||
if (array == null)
|
||||
throw new ArgumentNullException(nameof(array));
|
||||
ArgumentNullException.ThrowIfNull(array);
|
||||
|
||||
if (arrayIndex < 0)
|
||||
throw new ArgumentNullException(nameof(arrayIndex));
|
||||
|
||||
@@ -32,8 +32,7 @@ namespace OpenRA.Primitives
|
||||
/// <param name="count">The length of the segment.</param>
|
||||
public SegmentStream(Stream stream, long offset, long count)
|
||||
{
|
||||
if (stream == null)
|
||||
throw new ArgumentNullException(nameof(stream));
|
||||
ArgumentNullException.ThrowIfNull(stream);
|
||||
if (!stream.CanSeek)
|
||||
throw new ArgumentException("stream must be seekable.", nameof(stream));
|
||||
if (offset < 0)
|
||||
|
||||
Reference in New Issue
Block a user