docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method CompareHashes

    CompareHashes<TOldValue, TOldGetter, TNewValue, TNewGetter>(int, void*, int, void*, int*, int*, out int, out int)

    Compare hashes of two collections and provide a list of indices removeIndices to remove in oldHashes and a list of indices addIndices to add in newHashes.

    Assumes that newHashes and oldHashes are sorted.

    Declaration
    public static int CompareHashes<TOldValue, TOldGetter, TNewValue, TNewGetter>(int oldHashCount, void* oldHashes, int newHashCount, void* newHashes, int* addIndices, int* removeIndices, out int addCount, out int remCount) where TOldValue : struct where TOldGetter : struct, CoreUnsafeUtils.IKeyGetter<TOldValue, Hash128> where TNewValue : struct where TNewGetter : struct, CoreUnsafeUtils.IKeyGetter<TNewValue, Hash128>
    Parameters
    Type Name Description
    int oldHashCount

    Number of hashes in oldHashes.

    void* oldHashes

    Previous hashes to compare.

    int newHashCount

    Number of hashes in newHashes.

    void* newHashes

    New hashes to compare.

    int* addIndices

    Indices of element to add in newHashes will be written here.

    int* removeIndices

    Indices of element to remove in oldHashes will be written here.

    int addCount

    Number of elements to add will be written here.

    int remCount

    Number of elements to remove will be written here.

    Returns
    Type Description
    int

    The number of operation to perform (

    addCount + remCount
    )
    Type Parameters
    Name Description
    TOldValue

    Old value type.

    TOldGetter

    Old getter type.

    TNewValue

    New value type.

    TNewGetter

    New getter type.

    CompareHashes(int, Hash128*, int, Hash128*, int*, int*, out int, out int)

    Compare hashes.

    Declaration
    public static int CompareHashes(int oldHashCount, Hash128* oldHashes, int newHashCount, Hash128* newHashes, int* addIndices, int* removeIndices, out int addCount, out int remCount)
    Parameters
    Type Name Description
    int oldHashCount

    Number of hashes in oldHashes.

    Hash128* oldHashes

    Previous hashes to compare.

    int newHashCount

    Number of hashes in newHashes.

    Hash128* newHashes

    New hashes to compare.

    int* addIndices

    Indices of element to add in newHashes will be written here.

    int* removeIndices

    Indices of element to remove in oldHashes will be written here.

    int addCount

    Number of elements to add will be written here.

    int remCount

    Number of elements to remove will be written here.

    Returns
    Type Description
    int

    The number of operation to perform (

    addCount + remCount
    )
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)