Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NSMutableArray removeObject:] does not remove all occurrences of an object in the array. #2771

Closed
rupertdaniel opened this issue Jun 29, 2017 · 0 comments

Comments

@rupertdaniel
Copy link

[NSMutableArray removeObject:] currently only removes the first occurrence of an object instance in the array. As per the reference platform, this method should remove all occurrences of an object instance in the array.

DHowett-MSFT pushed a commit to DHowett-MSFT/WinObjC that referenced this issue Jul 7, 2017
* removeObject:inRange: was originally finding the first instance of the
  object in the range, and then doing an array-wide search-and-remove
  every time it found one. This was very clearly wrong.
  This method was also augmented to do batch removals where possible.
* removeObject: is supposed to remove every instance of the found object.
  It wasn't doing so. Fixes microsoft#2771.
* removeObjectIdenticalTo: is supposed to remove every instance of the
  found object. It also wasn't doing so.
* removeObjectIdenticalTo:inRange: wasn't implemented.
* exchangeObjectAtIndex:withObjectAtIndex: was not using its CF
  optimized implementation.
* Methods that mutated ranges were not bounds-checking those ranges.
DHowett-MSFT pushed a commit to DHowett-MSFT/WinObjC that referenced this issue Jul 7, 2017
* removeObject:inRange: was originally finding the first instance of the
  object in the range, and then doing an array-wide search-and-remove
  every time it found one. This was very clearly wrong.
* removeObject: is supposed to remove every instance of the found object.
  It wasn't doing so. Fixes microsoft#2771.
* removeObjectIdenticalTo: is supposed to remove every instance of the
  found object. It also wasn't doing so.
* removeObjectIdenticalTo:inRange: wasn't implemented.
* exchangeObjectAtIndex:withObjectAtIndex: was not using its CF
  optimized implementation.
* Methods that mutated ranges were not bounds-checking those ranges.
DHowett-MSFT pushed a commit that referenced this issue Jul 7, 2017
* removeObject:inRange: was originally finding the first instance of the
  object in the range, and then doing an array-wide search-and-remove
  every time it found one. This was very clearly wrong.
* removeObject: is supposed to remove every instance of the found object.
  It wasn't doing so. Fixes #2771.
* removeObjectIdenticalTo: is supposed to remove every instance of the
  found object. It also wasn't doing so.
* removeObjectIdenticalTo:inRange: wasn't implemented.
* exchangeObjectAtIndex:withObjectAtIndex: was not using its CF
  optimized implementation.
* Methods that mutated ranges were not bounds-checking those ranges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant