Thanks for you vote!  I also guessed to_set.to_a is an optimization
but a naive benchmark shows it actually slower:

  require 'set'
  require 'benchmark'

  data = (1..1000_000).map{rand 1000}

  Benchmark.bm do |bm|
    bm.report 'to_set.to_a' do
      data.to_set.to_a
    end

    bm.report 'uniq' do
      data.uniq
    end
  end


On Dec 11, 1:53 pm, Pratik <[EMAIL PROTECTED]> wrote:
> I suppose to_set.to_a was an optimization. I had a similar patch is
> the past -http://dev.rubyonrails.org/ticket/8802But you have more
> tests and a valid point, so +1.
>
> It'd be great if you could somehow find a way to use existing
> fixtures. No big deal though.
>
> On Dec 11, 2007 9:29 AM, Remco van t Veer <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi,
>
> > I've just submitted a patch for ActiveRecord;
>
> >  http://dev.rubyonrails.org/ticket/10463
>
> > The patch includes new fixtures because I could not find a applicable
> > combination among the existing fixtures.  I hope that's okee.
>
> > Please +1 or comment it.
>
> > Thanks,
> > Remco
>
> --
> Cheers!
> - Pratikhttp://m.onkey.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to