From 73d2bd8e6640eaa7cf7417ed838f74439e25226f Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Thu, 31 Oct 2024 19:03:06 +0100 Subject: [PATCH] style: simplify --- lib/features/search/search.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/features/search/search.js b/lib/features/search/search.js index e6acd34a7..831dc8029 100644 --- a/lib/features/search/search.js +++ b/lib/features/search/search.js @@ -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;