From aabac0804d9c2d96c82663c01f06b5dc9ffceaac 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 Signed-off-by: Martin Renvoize (cherry picked from commit 119347c76e5acc262380cc22b13684cca5a19e8d) Signed-off-by: Lucas Gass --- svc/checkouts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svc/checkouts b/svc/checkouts index 278545a72c..b3f026ddcb 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -244,7 +244,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.39.2