Search Unity

Question about NativeMultiHashMap<T, Q>.GetKeyArray()

Discussion in 'Data Oriented Technology Stack' started by PublicEnumE, Sep 11, 2019.

  1. PublicEnumE

    PublicEnumE

    Joined:
    Feb 3, 2019
    Posts:
    106
    Are the keys returned from a NativeMultiHashMap<T>.GetKeyArray() call guaranteed to already be sorted?

    For example, if I add values to the NativeMultiHashMap for keys in a random order, and then call .GetKeyArray() on it, will it be ordered with all the like keys grouped together, like so?

    [0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 5, 5, 5]
     
    Last edited: Sep 11, 2019
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,663
    Identical keys will be grouped, won't be ordered though.
     
    PublicEnumE likes this.