> -----Original Message-----
> From: Yukihiro Matsumoto [mailto:matz / ruby-lang.org] 
> Sent: Monday, June 23, 2008 2:20 AM
> To: ruby-core / ruby-lang.org
> Subject: [ruby-core:17380] Re: A faster Array#delete
> 
> Hi,
> 
> In message "Re: [ruby-core:17356] A faster Array#delete"
>     on Sat, 21 Jun 2008 10:18:31 +0900, Daniel Berger 
> <djberg96 / gmail.com> writes:
> 
> |I noticed that the Array#delete method in array.c is 
> basically copying 
> |the existing array element by element into a new array object. I 
> |suspected it could be improved so I tried this.
> |
> |Using an approach similar to Array#delete_at, I came up with this:
> |
> |VALUE rb_ary_delete(VALUE self, VALUE v_object){
> 
> This patch gave me no significant performance improvement on 
> my Linux box.  Does any one confirm?

I think a bug I had in the original code caused a false speedup. Sorry.

>Besides that, it 
> doesn't work well (out of bound access) if the comparing 
> method alters (e.g. shorten) the receiver.

Can you give us some examples? They would be useful test cases.

Thanks,

Dan


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication n error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.