initialPrefabs logo
  • Home 
  • Blog 
  • Tools 
  • Tags 
  1. Home
  2. Tools
  3. No Alloc Collections Documentation
  4. NoAllocHashSet

NoAllocHashSet

1 min read • 116 words
Tools   API  
Tools   API  
Share via
initialPrefabs
Link copied to clipboard

On this page
  • namespace InitialPrefabs.Collections
  • Summary
  • TypeParam
  • int FillSpan(ref Span<T> span)
  • bool TryAdd(T item)
    • Summary
    • Param
    • Returns
  • void Clear()
    • Summary
  • bool Contains(T item)
    • Summary
    • Param
    • Returns

NoAllocHashSet  

namespace InitialPrefabs.Collections  

Summary  

A stack only hashset that uses a Span{T} as its internal data structure.

TypeParam  

Any type implementing IEquatable{T}

int FillSpan(ref Span<T> span)  

bool TryAdd(T item)  

Summary  

Attempts to add an element to the HashSet if it does not exist.

Param  

Parameter Description
item The value to add

Returns  

bool - True, if added

void Clear()  

Summary  

Clears all elements within the NoAllocHashSet{T]}

bool Contains(T item)  

Summary  

Checks if an element exists in the hash set.

Param  

Parameter Description
item The element to find

Returns  

bool - True, if it exists, otherwise false

Go back to API Home

 NoAllocHashMap
NoAllocList 
On this page:
  • namespace InitialPrefabs.Collections
  • Summary
  • TypeParam
  • int FillSpan(ref Span<T> span)
  • bool TryAdd(T item)
    • Summary
    • Param
    • Returns
  • void Clear()
    • Summary
  • bool Contains(T item)
    • Summary
    • Param
    • Returns
Follow Us!

Contact us if you want to work with us for your games and art projects!

     
Copyright © 2016-2025 InitialPrefabs
initialPrefabs
Code copied to clipboard