Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Fix endless loop if index set is nil - #2778

Open
Felipe A Rodriguez (xFAR) wants to merge 2 commits into
microsoft:developfrom
xFAR:develop
Open

Fix endless loop if index set is nil#2778
Felipe A Rodriguez (xFAR) wants to merge 2 commits into
microsoft:developfrom
xFAR:develop

Conversation

@xFAR

@xFAR Felipe A Rodriguez (xFAR) commented Jul 20, 2017

Copy link
Copy Markdown

Raises an invalid arg exception per Apple implementation and docs.


This change is Reviewable

@DHowett-MSFT Dustin L. Howett (MSFT) (DHowett-MSFT) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Felipe A Rodriguez (@xFAR)! Thanks for the contribution.

I'd like to accept this pull request, but I've got a couple minor issues:

  • Our coding convention requires four spaces be used per indentation level than one tab
  • We have a macro (admittedly difficult to discover!) called NS_COLLECTION_THROW_IF_NULL_REASON; you can place it at the top of this function and keep the rest of the code the same.
NS_COLLECTION_THROW_IF_NULL_REASON(indexes, @"indexes must not be nil");

Would you mind writing tests (in NSArrayTests.mm) for this method (with a nil index set) as well? You can use the other tests as a template.

@xFAR

Copy link
Copy Markdown
Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants