From 701a76162516165082bf3f53a6b1c7c023b78050 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 7 Nov 2019 13:34:31 +0100 Subject: [PATCH] Bug 23427: Simplify sort logic This is the usual syntax. Signed-off-by: Jonathan Druart --- svc/checkouts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svc/checkouts b/svc/checkouts index dc559a207f..f8fd541f36 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -270,7 +270,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { unless ( C4::Context->preference('todaysIssuesDefaultSortOrder') eq 'desc' ); # earliest to latest @checkouts_previous = - sort { $a->{date_due} eq $b->{date_due} ? $a->{timestamp} cmp $b->{timestamp} : $a->{date_due} cmp $b->{date_due} } + sort { $a->{date_due} cmp $b->{date_due} || $a->{timestamp} cmp $b->{timestamp} } @checkouts_previous; # latest to earliest @checkouts_previous = reverse(@checkouts_previous) unless ( C4::Context->preference('previousIssuesDefaultSortOrder') eq 'desc' ); # earliest to latest -- 2.11.0