public void UnsafeHashMap_RemoveOnEmptyMap_DoesNotThrow()
    {
        var container = new UnsafeHashMap <int, int>(0, Allocator.Temp);

        Assert.DoesNotThrow(() => container.Remove(0));
        Assert.DoesNotThrow(() => container.Remove(-425196));
        container.Dispose();
    }
Ejemplo n.º 2
0
 public void DeallocateSystemData(uint systemId)
 {
     if (!UnsafeHashMap.ContainsKey(SystemData, systemId))
     {
         throw new InvalidOperationException();
     }
     UnsafeUtility.Free((void *)UnsafeHashMap.Get <uint, IntPtr>(SystemData, systemId), Allocator.Persistent);
     UnsafeHashMap.Remove(SystemData, systemId);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Removes the element with the specified key from the container.
 /// </summary>
 /// <param name="key">The key of the element to remove.</param>
 /// <returns>Returns true if the key was removed from the container, otherwise returns false indicating key wasn't in the container.</returns>
 public bool Remove(TKey key)
 {
     CheckWrite();
     return(m_HashMapData.Remove(key));
 }