Skip to content

Instantly share code, notes, and snippets.

@fpillet
Created November 27, 2010 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fpillet/717759 to your computer and use it in GitHub Desktop.
Save fpillet/717759 to your computer and use it in GitHub Desktop.
@_Kolin: remove duplicates without using a set
// If you really want to do this without using a set, you can do it this way
NSUInteger count = [marray count];
for (NSUInteger i = 0; i < (count-1); i++) {
[marray removeObjectIdenticalTo:[marray objectAtIndex:i] inRange:NSMakeRange(i+1, count-i-1);
count = [marray count];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment