Re: [code-review] Tie::Array::Sorted

Tony Bowden <[email protected]> Thu, 13 Nov 2003 15:02:25 +0000
Newsgroups gmane.comp.lang.perl.code-review-ladder
Message-ID <[email protected]>
On Thu, Nov 13, 2003 at 08:55:05AM -0500, Paul Hoffman wrote:
> >Just for interest, I decided to replace your PUSH with the naive:
> >	sub PUSH {
> >		my ($self, @elems) = @_;
> >		$self->{array} = [ sort (@{ $self->{array} }, @elems) ];
> >	}
> Wouldn't this be faster? --
>    sub PUSH {
>       my $self = shift;
>       $self->{array} = [ sort (@{ $self->{array} }, @_) ];
>    }

Probably, but I wasn't trying to micro-optimise; I was merely trying to
compare the two approaches.

Tony