Skip to content

Commit d09e752

Browse files
More refactoring
1 parent 223943b commit d09e752

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/cursorless-engine/src/util/allocateHats/allocateHats.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ function getTokenRemainingHatCandidates(
184184
// and calling tiny functions lots of times.
185185

186186
for (const grapheme of graphemes) {
187+
const isFirstLetter = firstLetterOffsets.has(grapheme.tokenStartOffset);
188+
187189
for (const style of graphemeRemainingHatCandidates.get(grapheme.text)) {
188190
// Allocating and pushing all of these objects is
189191
// the single most expensive thing in hat allocation.
@@ -192,7 +194,7 @@ function getTokenRemainingHatCandidates(
192194
grapheme,
193195
style,
194196
penalty: enabledHatStyles[style].penalty,
195-
isFirstLetter: firstLetterOffsets.has(grapheme.tokenStartOffset),
197+
isFirstLetter,
196198
});
197199
}
198200
}

0 commit comments

Comments
 (0)