Skip to content

Commit a330f0f

Browse files
committed
freeze FuzzyScore.Default, microsoft#74203
1 parent cc115e8 commit a330f0f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/vs/base/common/filters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ export namespace FuzzyScore {
491491
/**
492492
* No matches and value `-100`
493493
*/
494-
export const Default: [-100, 0, 0] = [-100, 0, 0];
494+
export const Default: [-100, 0, 0] = <[-100, 0, 0]>Object.freeze([-100, 0, 0]);
495495

496496
export function isDefault(score?: FuzzyScore): score is [-100, 0, 0] {
497497
return !score || (score[0] === -100 && score[1] === 0 && score[2] === 0);

src/vs/editor/contrib/suggest/completionModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export class CompletionModel {
222222
} else {
223223
// re-run the scorer on the label in the hope of a result BUT use the rank
224224
// of the filterText-match
225-
item.score = scoreFn(word, wordLow, wordPos, item.completion.label, item.labelLow, 0, false) || FuzzyScore.Default;
225+
item.score = scoreFn(word, wordLow, wordPos, item.completion.label, item.labelLow, 0, false) || [-100, 0, 0];
226226
item.score[0] = match[0]; // use score from filterText
227227
}
228228

0 commit comments

Comments
 (0)