Mantis - Squeak
Viewing Issue Advanced Details
6964 Collections trivial N/A 02-27-08 20:39 02-06-11 23:48
nicolas cellier  
leves  
normal  
closed 3.10  
fixed  
none    
none 4.1  
0006964: [clean-up] SequenceableCollection>>startsWith: duplicates beginsWith:

This selector is declared as a *services-base and sent by ServiceShortcuts.

It does the same as beginsWith:, far less efficiently:
1) uselessely creates a subcollection
2) iterates the whole index range when it could answer false at first mismatch

clean it up!
 Services-startsWith-cleanup-M6964-nice.1.cs [^] (4,004 bytes) 02-27-08 20:53
 Services-startsWith-cleanup-M6964-nice.2.cs [^] (3,987 bytes) 03-14-08 20:30

Notes
(0011882)
nicolas cellier   
02-27-08 21:03   
Ah, forgot to say, SequenceableCollection is the single implementor of startsWith:

I propose in nice.1.cs to move method to deprecated (with a halt: to encourage anyone encountering it to fix it).
(0011921)
nicolas cellier   
03-14-08 20:31   
I was not aware of the #deprecated: message.
It is far better than the halt: I initially proposed.

So here comes nice.2.cs
(0013913)
leves   
11-07-10 02:57   
It's done.