From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id D5D471FC0B for ; Tue, 5 Oct 2021 12:48:04 +0000 (UTC) From: Eric Wong To: mwrap-perl@80x24.org Subject: [PATCH 6/7] psgi: sort "location" column lexically Date: Tue, 5 Oct 2021 12:48:02 +0000 Message-Id: <20211005124803.7215-7-e@80x24.org> In-Reply-To: <20211005124803.7215-1-e@80x24.org> References: <20211005124803.7215-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It's probably not worth sorting line numbers for location. --- lib/Devel/Mwrap/PSGI.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Devel/Mwrap/PSGI.pm b/lib/Devel/Mwrap/PSGI.pm index 5bb7c36..52dbebe 100644 --- a/lib/Devel/Mwrap/PSGI.pm +++ b/lib/Devel/Mwrap/PSGI.pm @@ -92,7 +92,11 @@ sub each_gt { } @f)); my @all; Devel::Mwrap::each($min, \&accumulate_i, \@all); - @all = sort { $b->[$sc] <=> $a->[$sc] } @all; + if ($sc eq $#FIELDS) { # locations are sorted alphabetically + @all = sort { $a->[$sc] cmp $b->[$sc] } @all; + } else { # everything else is numeric + @all = sort { $b->[$sc] <=> $a->[$sc] } @all; + } my $age = Devel::Mwrap::current_age(); my $live = $age - Devel::Mwrap::total_bytes_freed(); print $fh <