diff options
Diffstat (limited to 'source/core')
| -rw-r--r-- | source/core/slang-dictionary.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/core/slang-dictionary.h b/source/core/slang-dictionary.h index eef7d6908..470e5f6d9 100644 --- a/source/core/slang-dictionary.h +++ b/source/core/slang-dictionary.h @@ -381,6 +381,13 @@ namespace Slang else SLANG_ASSERT_FAILURE("Inconsistent find result returned. This is a bug in Dictionary implementation."); } + void Set(const TKey& key, const TValue& value) + { + if (auto ptr = TryGetValueOrAdd(key, value)) + { + *ptr = value; + } + } template<typename KeyType> bool ContainsKey(const KeyType& key) const |
