Skip to content

Commit

Permalink
pkp/pkp-lib#10111 Dropped the reference assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasraoni committed Jun 25, 2024
1 parent 203d098 commit 081c3f0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions classes/search/MonographSearch.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ function getSparseArray($unorderedResults, $orderBy, $orderDir, $exclude) {
// Calculate a well-ordered (unique) score.
$resultCount = count($unorderedResults);
$i = 0;
foreach ($unorderedResults as $submissionId => &$data) {
// Reference is necessary to permit modification
$data['score'] = ($resultCount * $data['count']) + $i++;
foreach ($unorderedResults as $submissionId => $data) {
$data[$submissionId]['score'] = ($resultCount * $data['count']) + $i++;
}

// If we got a primary sort order then apply it and use score as secondary
Expand Down

0 comments on commit 081c3f0

Please sign in to comment.