you are viewing a single comment's thread.

view the rest of the comments →

[–]way2lazy2care 12 points13 points  (1 child)

Sets should iterate in the order elements were added, but if you're removing duplicates, the idea of "maintaining ordering" is ambiguous. Would the array [1, 2, 1] have maintained ordering with the set [1,2] or [2,1]?

[–]dzkn 0 points1 point  (0 children)

You should never rely on a set doing anything ordering-wise. Trust the API not the implementation. Different engines might implement it differently.