bugGNUstep - Bugs: bug #19451, Implement...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #19451: Implement (NSMutableArray*)filterUsingPredicate in NSPredicate.m

Submitted by:  Romain <romainbrestac>
Submitted on:  Fri 30 Mar 2007 11:06:34 AM UTC  
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Mon 16 Apr 2007 07:03:47 AM UTC, comment #4: 

Ah ... just realised ... when you said 'iterating' you perhaps referred to the original patch using an enumerator and assumed that the implementation I did used a reverse enumerator.  In fact I used -count and -objectAtIndex:

The point about using NSEnumerator and modifying the collection being enumerated is generally valid, but does not apply in this case.

Richard Frith-Macdonald <CaS>
Project Member
Mon 16 Apr 2007 06:55:25 AM UTC, comment #3: 

I think a subclass which subverts normal array semantics to such an extent that this does not work would probably be unusable for most purposes.  The code depends upon the order of objects in an array remaining the same after removal of an element, and anything that doesn't do that really doesn't deserve to be called an array.

Richard Frith-Macdonald <CaS>
Project Member
Mon 16 Apr 2007 06:39:29 AM UTC, comment #2: 

Just wanted to mention that this might not work for some custom sub classes of NSMutableArray that do not have this implmentation detail of being able to remove objects when iterating in reverse order.

David Ayers <ayers>
Project Member
Sun 15 Apr 2007 09:53:07 AM UTC, comment #1: 

Thanks ... I added a safe version of that code (step backwards through the array so that removing objects does not confuse things) and added the header declaration.

Richard Frith-Macdonald <CaS>
Project Member
Fri 30 Mar 2007 11:06:34 AM UTC, original submission:  

As the title says. Diff attached.

I have others patches for predicates but I need to clarify some points first. Can the original contributor of NSPredicate.m & Co tell me if he is available for some questions about his work ? Thanks.

Romain <romainbrestac>

 

Attached Files
file #12345:  NSPredicate.diff added by romainbrestac (605B - filterUsingPredicate Impl.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ayers (Posted a comment)
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by romainbrestac (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-04-15 CaS StatusNone => Fixed
        Open/ClosedOpen => Closed
    2007-03-30 romainbrestac Attached File- => Added NSPredicate.diff, #12345

    Back to the top


    Powered by Savane 3.5