Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

CPArray insertObjects:atIndexes: fix

#136

There is a typo in arg naming (anIndexSet vs indexes). position starts at CPNotFound (?) index should be incremented after insertion

Reported by cacaodev · November 10th, 2008 @ 12:27 PM

State: resolved
Milestone: 0.6
Assigned to: Francisco Tolmasky Francisco Tolmasky

Activity

  1. Francisco Tolmasky
    Francisco Tolmasky
    • Milestone set to 0.6

    It starts at CPNotFound because indexGreaterThanOrEqualToIndex: returns the first index if you pass in CPNotFound. Similarly we update the index in the access (objects[index++]), but this fixes the indexes vs anIndexSet mismatch so looks good to me. Could you possibly create a few test cases for this?

    November 12th, 2008 @ 05:13 PM

  2. cacaodev
    cacaodev

    According to cocoa doc, Apple is using a for loop for this. So maybe it's better to follow to same pattern. I also added exceptions matching cocoa behavior.

    We can also wait and make a patch later for all exceptions needed for similar methods (remove, replace ...).

    November 13th, 2008 @ 11:57 AM

  3. Francisco Tolmasky
    Francisco Tolmasky
    • Assigned user set to Francisco Tolmasky

    OK, I went ahead and added a few test cases for this which required fixing isEqual: in CPArray. I also made a few minor stylistic changes, but it now looks ready to go, thanks!

    November 13th, 2008 @ 02:45 PM

  4. admin (at 280north)
    admin (at 280north)
    • State changed from new to resolved

    (from [e1d57aac3b65c7b2b3614d0b0ac3b335b6b6536f]) Fix for broken insertObjects:atIndexes: and tests and isEqual.

    [#136 CPArray insertObjects:atIndexes: fix state:resolved]

    Reviewed by me. http://github.com/280north/cappu...

    November 13th, 2008 @ 02:56 PM

  5. Francisco Tolmasky
    Francisco Tolmasky

    I wasn't able to --author you since your patch didn't have a correct author field, could you look into that so we can start giving you credit?

    November 13th, 2008 @ 02:57 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.