Skip to content

Commit fc4b583

Browse files
authored
Merge pull request microsoft#159667 from microsoft/tyriar/159617_followup
Improve arg names in terminalIconsEqual
2 parents 9e18376 + 61bc0be commit fc4b583

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/vs/platform/terminal/common/terminalProfiles.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,29 +83,29 @@ export function terminalProfileArgsMatch(args1: string | string[] | undefined, a
8383
return false;
8484
}
8585

86-
export function terminalIconsEqual(iconOne?: TerminalIcon, iconTwo?: TerminalIcon): boolean {
87-
if (!iconOne && !iconTwo) {
86+
export function terminalIconsEqual(a?: TerminalIcon, b?: TerminalIcon): boolean {
87+
if (!a && !b) {
8888
return true;
89-
} else if (!iconOne || !iconTwo) {
89+
} else if (!a || !b) {
9090
return false;
9191
}
9292

93-
if (ThemeIcon.isThemeIcon(iconOne) && ThemeIcon.isThemeIcon(iconTwo)) {
94-
return iconOne.id === iconTwo.id && iconOne.color === iconTwo.color;
93+
if (ThemeIcon.isThemeIcon(a) && ThemeIcon.isThemeIcon(b)) {
94+
return a.id === b.id && a.color === b.color;
9595
}
96-
if (typeof iconOne === 'object' && 'light' in iconOne && 'dark' in iconOne
97-
&& typeof iconTwo === 'object' && 'light' in iconTwo && 'dark' in iconTwo) {
98-
const castedIcon = (iconOne as { light: unknown; dark: unknown });
99-
const castedIconTwo = (iconTwo as { light: unknown; dark: unknown });
100-
if ((URI.isUri(castedIcon.light) || isUriComponents(castedIcon.light)) && (URI.isUri(castedIcon.dark) || isUriComponents(castedIcon.dark))
101-
&& (URI.isUri(castedIconTwo.light) || isUriComponents(castedIconTwo.light)) && (URI.isUri(castedIconTwo.dark) || isUriComponents(castedIconTwo.dark))) {
102-
return castedIcon.light.path === castedIconTwo.light.path && castedIcon.dark.path === castedIconTwo.dark.path;
96+
if (typeof a === 'object' && 'light' in a && 'dark' in a
97+
&& typeof b === 'object' && 'light' in b && 'dark' in b) {
98+
const castedA = (a as { light: unknown; dark: unknown });
99+
const castedB = (b as { light: unknown; dark: unknown });
100+
if ((URI.isUri(castedA.light) || isUriComponents(castedA.light)) && (URI.isUri(castedA.dark) || isUriComponents(castedA.dark))
101+
&& (URI.isUri(castedB.light) || isUriComponents(castedB.light)) && (URI.isUri(castedB.dark) || isUriComponents(castedB.dark))) {
102+
return castedA.light.path === castedB.light.path && castedA.dark.path === castedB.dark.path;
103103
}
104104
}
105-
if ((URI.isUri(iconOne) && URI.isUri(iconTwo)) || (isUriComponents(iconOne) || isUriComponents(iconTwo))) {
106-
const castedIcon = (iconOne as { scheme: unknown; path: unknown });
107-
const castedIconTwo = (iconTwo as { scheme: unknown; path: unknown });
108-
return castedIcon.path === castedIconTwo.path && castedIcon.scheme === castedIconTwo.scheme;
105+
if ((URI.isUri(a) && URI.isUri(b)) || (isUriComponents(a) || isUriComponents(b))) {
106+
const castedA = (a as { scheme: unknown; path: unknown });
107+
const castedB = (b as { scheme: unknown; path: unknown });
108+
return castedA.path === castedB.path && castedA.scheme === castedB.scheme;
109109
}
110110

111111
return false;

0 commit comments

Comments
 (0)