robb / Underscore.m

A DSL for Data Manipulation
https://robb.github.io/Underscore.m/
MIT License
1.47k stars 99 forks source link

uniq method change the order. #32

Closed breath103 closed 11 years ago

breath103 commented 11 years ago

hi i've trying to remove the duplicated cards when i append cards array, so i used _.uniq. it's working well with a just removing duplicated cards, but a problem is that it's changing the order of whole array.

i think it's because uniq method using NSSet. anyway, is there any good way to keep order of it?

[controller setCards:@[@"1",@"2",@"3",@"4"]]; [controller appendCards:@[@"2",@"3",@"5",@"6"]];

        [controller cards] should equal(@[
                                            @"1",@"2",@"3",@"4",@"5",@"6"
                                        ]);
robb commented 11 years ago

You're right, that should not happen. I'll look into writing a fix.