From bcbcd4bf0917c2b25a6da9c00857494a615a7f24 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Tue, 24 Apr 2018 14:41:09 -0400 Subject: [PATCH] Code simplification. --- .../src/VuFind/View/Helper/Root/RecordDataFormatter.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/module/VuFind/src/VuFind/View/Helper/Root/RecordDataFormatter.php b/module/VuFind/src/VuFind/View/Helper/Root/RecordDataFormatter.php index df5bd32ca08..c373e8e0f9d 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/RecordDataFormatter.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/RecordDataFormatter.php @@ -60,12 +60,7 @@ class RecordDataFormatter extends AbstractHelper */ public function specSortCallback($a, $b) { - $posA = $a['pos'] ?? 0; - $posB = $b['pos'] ?? 0; - if ($posA === $posB) { - return 0; - } - return $posA < $posB ? -1 : 1; + return ($a['pos'] ?? 0) <=> ($b['pos'] ?? 0); } /** -- GitLab