mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
perf: check sentiment before state to avoid unnecessary computation
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
This commit is contained in:
committed by
Henning Dieterichs
parent
7704adeb3e
commit
c308cc9f87
+5
-5
@@ -54,17 +54,17 @@ export class InlineCompletionLanguageStatusBarContribution extends Disposable im
|
||||
});
|
||||
|
||||
this._register(autorunWithStore((reader, store) => {
|
||||
const state = this._state.read(reader);
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Do not show the Copilot icon in the language status when AI features are disabled
|
||||
const sentiment = this._sentiment.read(reader);
|
||||
if (sentiment.hidden) {
|
||||
return;
|
||||
}
|
||||
|
||||
const state = this._state.read(reader);
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
|
||||
const status = state.status.read(reader);
|
||||
|
||||
const statusMap: Record<typeof status, { shortLabel: string; label: string; loading: boolean }> = {
|
||||
|
||||
Reference in New Issue
Block a user