aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/Translation/IntervalTree.cs
diff options
context:
space:
mode:
authorBerkan Diler <berkan.diler1@ingka.ikea.com>2022-12-27 20:27:11 +0100
committerGitHub <noreply@github.com>2022-12-27 20:27:11 +0100
commit0d3b82477ecbf7128340b6725a79413427c68748 (patch)
tree2d62c68e38a3c4c79ef7cc1d92700617a40e70ca /ARMeilleure/Translation/IntervalTree.cs
parent470be03c2ff22346a1f0ae53fa25f53c4d1790b5 (diff)
Use new ArgumentNullException and ObjectDisposedException throw-helper API (#4163)1.1.493
Diffstat (limited to 'ARMeilleure/Translation/IntervalTree.cs')
-rw-r--r--ARMeilleure/Translation/IntervalTree.cs15
1 files changed, 3 insertions, 12 deletions
diff --git a/ARMeilleure/Translation/IntervalTree.cs b/ARMeilleure/Translation/IntervalTree.cs
index 79662bc9..9af01bea 100644
--- a/ARMeilleure/Translation/IntervalTree.cs
+++ b/ARMeilleure/Translation/IntervalTree.cs
@@ -67,10 +67,7 @@ namespace ARMeilleure.Translation
/// <returns>True if the value was added, false if the start key was already in the dictionary</returns>
public bool AddOrUpdate(K start, K end, V value, Func<K, V, V> updateFactoryCallback)
{
- if (value == null)
- {
- throw new ArgumentNullException(nameof(value));
- }
+ ArgumentNullException.ThrowIfNull(value);
return BSTInsert(start, end, value, updateFactoryCallback, out IntervalTreeNode<K, V> node);
}
@@ -85,10 +82,7 @@ namespace ARMeilleure.Translation
/// <returns><paramref name="value"/> if <paramref name="start"/> is not yet on the tree, or the existing value otherwise</returns>
public V GetOrAdd(K start, K end, V value)
{
- if (value == null)
- {
- throw new ArgumentNullException(nameof(value));
- }
+ ArgumentNullException.ThrowIfNull(value);
BSTInsert(start, end, value, null, out IntervalTreeNode<K, V> node);
return node.Value;
@@ -152,10 +146,7 @@ namespace ARMeilleure.Translation
/// <returns>Node reference in the tree</returns>
private IntervalTreeNode<K, V> GetNode(K key)
{
- if (key == null)
- {
- throw new ArgumentNullException(nameof(key));
- }
+ ArgumentNullException.ThrowIfNull(key);
IntervalTreeNode<K, V> node = _root;
while (node != null)