aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/Common/EntryTable.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ARMeilleure/Common/EntryTable.cs')
-rw-r--r--ARMeilleure/Common/EntryTable.cs15
1 files changed, 3 insertions, 12 deletions
diff --git a/ARMeilleure/Common/EntryTable.cs b/ARMeilleure/Common/EntryTable.cs
index f3f3ce28..6f205797 100644
--- a/ARMeilleure/Common/EntryTable.cs
+++ b/ARMeilleure/Common/EntryTable.cs
@@ -53,10 +53,7 @@ namespace ARMeilleure.Common
/// <exception cref="ObjectDisposedException"><see cref="EntryTable{TEntry}"/> instance was disposed</exception>
public int Allocate()
{
- if (_disposed)
- {
- throw new ObjectDisposedException(null);
- }
+ ObjectDisposedException.ThrowIf(_disposed, this);
lock (_allocated)
{
@@ -83,10 +80,7 @@ namespace ARMeilleure.Common
/// <exception cref="ObjectDisposedException"><see cref="EntryTable{TEntry}"/> instance was disposed</exception>
public void Free(int index)
{
- if (_disposed)
- {
- throw new ObjectDisposedException(null);
- }
+ ObjectDisposedException.ThrowIf(_disposed, this);
lock (_allocated)
{
@@ -108,10 +102,7 @@ namespace ARMeilleure.Common
/// <exception cref="ArgumentException">Entry at <paramref name="index"/> is not allocated</exception>
public ref TEntry GetValue(int index)
{
- if (_disposed)
- {
- throw new ObjectDisposedException(null);
- }
+ ObjectDisposedException.ThrowIf(_disposed, this);
lock (_allocated)
{