Skip to content

Commit 65e5cc7

Browse files
committed
Use optional chaining
1 parent 7e32fb5 commit 65e5cc7

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

frontend/src/ts/utils/search-service.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,7 @@ export const buildSearchService = <T>(
156156
const scoreForToken = score * idf * termFrequency;
157157

158158
const quote = documents[document.id] as InternalDocument;
159-
if (
160-
ids.length === 0 ||
161-
(quote !== null && quote !== undefined && ids.includes(quote.id))
162-
) {
159+
if (ids.length === 0 || ids.includes(quote?.id)) {
163160
results.set(document.id, currentScore + scoreForToken);
164161
}
165162
});

0 commit comments

Comments
 (0)