develooper Front page | perl.perl5.porters | Postings from November 2005

Re: [PATCH] sort/multicall patch

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
November 2, 2005 07:18
Subject:
Re: [PATCH] sort/multicall patch
Message ID:
b77c1dce0511020718t282e4249uf5daaf132fc83aa1@mail.gmail.com
On 11/2/05, Nicholas Clark <nick@ccl4.org> wrote:
> On Wed, Nov 02, 2005 at 04:10:44PM +0100, Rafael Garcia-Suarez wrote:
>
> > I adapted the test count in concise-xs.t, and I just plainly removed the
> > last test of op/sort.t (as change #25957). It was failing horribly
> > both with and without threads, and moreover I'm not even sure we want
> > to ensure that it's possible to wipe out the array currently being sorted.
>
> To make sure perl doesn't coredump?

Oh, it wasn't dumping core; it was just sorting an array containing
undefined elements.

Here's the code I removed :

# Clearing the array we're sorting should be okay.
@a = (1..10);
@b = sort {@a=(); ($a+1)<=>($b+1)} @a;
ok("@b", "1 2 3 4 5 6 7 8 9 10", "clear array being sorted");

As you see this test expects that @b contains elements from @a, even
tough they're freed when @a is assigned the empty list to. (or
something like that)

But I'm not against it if that could work without penalty. (Also:
remember to test how the in-place sort behaves here)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About