Add(TKey, TValue)
Adds a new key-value pair. If the key is already present in the collection, this method should throw, but currently does not! Instead, it silently fails, without replacing said value.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: Unity.Collections.LowLevel.Unsafe
- Assembly: UnityEngine.ManagedKernelModule
Add(T, T)
public void Add(TKey key, TValue item)
Parameters
Remarks
Prefer UnsafeParallelHashMap<TKey, TValue>.TryAdd if your intent is to allow graceful failure, as this API will eventually become more strict (and begin to throw).