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 a7352f6 commit 6e0c408
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions classes/search/ArticleSearch.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 6e0c408

Please sign in to comment.