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

Group
 
 

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

Submitter:  Romain <romainbrestac>
Submitted:  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
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>
Group 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>
Group 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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    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.13-02a9.
    Corresponding source code