docs.unity3d.com
    Show / Hide Table of Contents

    Class HashSetExtensions

    Extension methods for HashSet<T> objects

    Inheritance
    Object
    HashSetExtensions
    Namespace: Unity.XRTools.Utils
    Syntax
    public static class HashSetExtensions : object

    Methods

    ExceptWithNonAlloc<T>(HashSet<T>, HashSet<T>)

    Like HashSet.ExceptWith() but without any garbage allocation or branches

    Declaration
    public static void ExceptWithNonAlloc<T>(this HashSet<T> self, HashSet<T> other)
    Parameters
    Type Name Description
    HashSet<T> self

    The set to remove from

    HashSet<T> other

    The set of elements to remove

    Type Parameters
    Name Description
    T

    The type contained in the set

    ExceptWithNonAlloc<T>(HashSet<T>, List<T>)

    Like HashSet.ExceptWith() but without any garbage allocation or branches

    Declaration
    public static void ExceptWithNonAlloc<T>(this HashSet<T> self, List<T> other)
    Parameters
    Type Name Description
    HashSet<T> self

    The set to remove from

    List<T> other

    The set of elements to remove

    Type Parameters
    Name Description
    T

    The type contained in the set

    First<T>(HashSet<T>)

    Like LINQ's .First(), but does not allocate

    Declaration
    public static T First<T>(this HashSet<T> set)
    Parameters
    Type Name Description
    HashSet<T> set

    Set to retrieve the element from

    Returns
    Type Description
    T

    The first element in the set

    Type Parameters
    Name Description
    T

    Type contained in the set

    In This Article
    • Methods
      • ExceptWithNonAlloc<T>(HashSet<T>, HashSet<T>)
      • ExceptWithNonAlloc<T>(HashSet<T>, List<T>)
      • First<T>(HashSet<T>)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023