wk8 / go-ordered-map

Optimal implementation of ordered maps for Golang - ie maps that remember the order in which keys were inserted.
Apache License 2.0
523 stars 40 forks source link

Is it safe to compare with reflect.DeepEqual? #39

Open derelbenkoenig opened 5 months ago

derelbenkoenig commented 5 months ago

If I had two OrderedMaps, which contain the same elements with the same insertion order, but which were created by different sequences of actions, then those should be equal in an abstract sense. But will they actually have the same underlying data structure?

For example if one was created by inserting 1, 2, and 4; and another was created by inserting 1, 2, 3, and 4, then removing 3, or by inserting 1,4, and 2, and then using MoveBefore to put 2 before 4.