Skip to content

Commit 1843a3c

Browse files
CopilotTyriar
andcommitted
Optimize compareCompletionsFn for better JIT performance
Co-authored-by: Tyriar <[email protected]>
1 parent 9843909 commit 1843a3c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalCompletionModel.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ const compareCompletionsFn = (leadingLineContent: string, a: TerminalCompletionI
3939
}
4040

4141
// Boost main and master branches for git commands
42-
const terminalSuggestProviderId = 'terminal-suggest';
43-
const isGitCommand = /^\s*git\b/.test(leadingLineContent);
44-
if (isGitCommand && a.completion.provider === terminalSuggestProviderId && b.completion.provider === terminalSuggestProviderId) {
42+
if (/^\s*git\b/.test(leadingLineContent) && a.completion.provider === 'terminal-suggest' && b.completion.provider === 'terminal-suggest') {
4543
const aLabel = typeof a.completion.label === 'string' ? a.completion.label : a.completion.label.label;
4644
const bLabel = typeof b.completion.label === 'string' ? b.completion.label : b.completion.label.label;
4745
const aIsMainOrMaster = aLabel === 'main' || aLabel === 'master';

0 commit comments

Comments
 (0)