Skip to content

Commit

Permalink
style: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Nov 1, 2024
1 parent 81ad9b5 commit 73d2bd8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/features/search/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,19 @@ function createResultSorter(keys) {

for (const key of keys) {

const tokensA = resultA.tokens[key];
const tokensB = resultB.tokens[key];

const tokenComparison = compareTokens(tokensA, tokensB);
const tokenComparison = compareTokens(
resultA.tokens[key],
resultB.tokens[key]
);

if (tokenComparison !== 0) {
return tokenComparison;
}

const stringComparison = compareStrings(resultA.item[ key ], resultB.item[ key ]);
const stringComparison = compareStrings(
resultA.item[ key ],
resultB.item[ key ]
);

if (stringComparison !== 0) {
return stringComparison;
Expand Down

0 comments on commit 73d2bd8

Please sign in to comment.