#136 ✓resolved
cacaodev

CPArray insertObjects:atIndexes: fix

Reported by cacaodev | 2008-11-10 12:27:40 UTC | in 0.6

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

Comments and changes to this ticket

  • Francisco Tolmasky

    Francisco Tolmasky 2008-11-12 17:13:04 UTC

    • 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?

  • cacaodev

    cacaodev 2008-11-13 11:57:20 UTC

    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 ...).

  • Francisco Tolmasky

    Francisco Tolmasky 2008-11-13 14:45:03 UTC

    • 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!

  • admin (at 280north)

    admin (at 280north) 2008-11-13 14:56:26 UTC

    • State changed from “new” to “resolved”

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

    [#136 state:resolved]

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

  • Francisco Tolmasky

    Francisco Tolmasky 2008-11-13 14:57:36 UTC

    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?

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Cappuccino Web Framework, including AppKit, Foundation, and Objective-J.

Shared Ticket Bins

People watching this ticket

Referenced by

Pages