Use new ArgumentNullException and ObjectDisposedException throw-helper API (#4163)
This commit is contained in:
parent
470be03c2f
commit
0d3b82477e
15 changed files with 58 additions and 196 deletions
|
@ -279,10 +279,7 @@ namespace Ryujinx.Memory
|
|||
{
|
||||
IntPtr ptr = _pointer;
|
||||
|
||||
if (ptr == IntPtr.Zero)
|
||||
{
|
||||
ThrowObjectDisposed();
|
||||
}
|
||||
ObjectDisposedException.ThrowIf(ptr == IntPtr.Zero, this);
|
||||
|
||||
int size = Unsafe.SizeOf<T>();
|
||||
|
||||
|
@ -312,10 +309,7 @@ namespace Ryujinx.Memory
|
|||
{
|
||||
IntPtr ptr = _pointer;
|
||||
|
||||
if (ptr == IntPtr.Zero)
|
||||
{
|
||||
ThrowObjectDisposed();
|
||||
}
|
||||
ObjectDisposedException.ThrowIf(ptr == IntPtr.Zero, this);
|
||||
|
||||
ulong endOffset = offset + size;
|
||||
|
||||
|
@ -454,7 +448,6 @@ namespace Ryujinx.Memory
|
|||
return true;
|
||||
}
|
||||
|
||||
private static void ThrowObjectDisposed() => throw new ObjectDisposedException(nameof(MemoryBlock));
|
||||
private static void ThrowInvalidMemoryRegionException() => throw new InvalidMemoryRegionException();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue