Use new ArgumentNullException and ObjectDisposedException throw-helper API (#4163)

This commit is contained in:
Berkan Diler 2022-12-27 20:27:11 +01:00 committed by GitHub
parent 470be03c2f
commit 0d3b82477e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 58 additions and 196 deletions

View file

@ -17,10 +17,7 @@ namespace Ryujinx.Common.Collections
/// <exception cref="ArgumentNullException"><paramref name="node"/> is null</exception>
public void Add(T node)
{
if (node == null)
{
throw new ArgumentNullException(nameof(node));
}
ArgumentNullException.ThrowIfNull(node);
Insert(node);
}
@ -32,10 +29,8 @@ namespace Ryujinx.Common.Collections
/// <exception cref="ArgumentNullException"><paramref name="node"/> is null</exception>
public void Remove(T node)
{
if (node == null)
{
throw new ArgumentNullException(nameof(node));
}
ArgumentNullException.ThrowIfNull(node);
if (Delete(node) != null)
{
Count--;
@ -50,10 +45,7 @@ namespace Ryujinx.Common.Collections
/// <exception cref="ArgumentNullException"><paramref name="searchNode"/> is null</exception>
public T GetNode(T searchNode)
{
if (searchNode == null)
{
throw new ArgumentNullException(nameof(searchNode));
}
ArgumentNullException.ThrowIfNull(searchNode);
T node = Root;
while (node != null)