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

Paul Hoffman <[email protected]> Thu, 13 Nov 2003 08:55:05 -0500
Newsgroups gmane.comp.lang.perl.code-review-ladder
Message-ID <[email protected]>
On Wed, 12 Nov 2003 at 17:03:14 +0000, Tony Bowden 
<[email protected]> 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} }, @_) ];
    }

Paul.

--
Paul Hoffman :: Taubman Medical Library :: Univ. of Michigan
[email protected] :: [email protected] :: http://www.nkuitse.com/