diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-08-14 19:46:11 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-08-14 19:46:11 +0200 |
commit | cb8846a7a3310f8513989da5aadb5202f048a1b3 (patch) | |
tree | cfbcf2506947d0f820208dd4cdb7a56c660ef0f9 /LibMatrix/Extensions/DictionaryExtensions.cs | |
parent | Update dependencies (diff) | |
download | LibMatrix-cb8846a7a3310f8513989da5aadb5202f048a1b3.tar.xz |
Code cleanup
Diffstat (limited to 'LibMatrix/Extensions/DictionaryExtensions.cs')
-rw-r--r-- | LibMatrix/Extensions/DictionaryExtensions.cs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/LibMatrix/Extensions/DictionaryExtensions.cs b/LibMatrix/Extensions/DictionaryExtensions.cs index fbc5cf5..f01cf68 100644 --- a/LibMatrix/Extensions/DictionaryExtensions.cs +++ b/LibMatrix/Extensions/DictionaryExtensions.cs @@ -3,8 +3,7 @@ namespace LibMatrix.Extensions; public static class DictionaryExtensions { public static bool ChangeKey<TKey, TValue>(this IDictionary<TKey, TValue> dict, TKey oldKey, TKey newKey) { - TValue value; - if (!dict.Remove(oldKey, out value)) + if (!dict.Remove(oldKey, out var value)) return false; dict[newKey] = value; // or dict.Add(newKey, value) depending on ur comfort |