mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Remove extra conditional
This commit is contained in:
parent
47e54aef5d
commit
e5e29375f0
|
@ -109,22 +109,20 @@ class EditorRegistry implements IEditorRegistry {
|
|||
const matchingDescriptors: EditorDescriptor[] = [];
|
||||
|
||||
for (const editor of this.editors) {
|
||||
const inputDescriptors = this.mapEditorToInputs.get(editor);
|
||||
if (inputDescriptors) {
|
||||
for (const inputDescriptor of inputDescriptors) {
|
||||
const inputClass = inputDescriptor.ctor;
|
||||
const inputDescriptors = this.mapEditorToInputs.get(editor) || [];
|
||||
for (const inputDescriptor of inputDescriptors) {
|
||||
const inputClass = inputDescriptor.ctor;
|
||||
|
||||
// Direct check on constructor type (ignores prototype chain)
|
||||
if (!byInstanceOf && input.constructor === inputClass) {
|
||||
matchingDescriptors.push(editor);
|
||||
break;
|
||||
}
|
||||
// Direct check on constructor type (ignores prototype chain)
|
||||
if (!byInstanceOf && input.constructor === inputClass) {
|
||||
matchingDescriptors.push(editor);
|
||||
break;
|
||||
}
|
||||
|
||||
// Normal instanceof check
|
||||
else if (byInstanceOf && input instanceof inputClass) {
|
||||
matchingDescriptors.push(editor);
|
||||
break;
|
||||
}
|
||||
// Normal instanceof check
|
||||
else if (byInstanceOf && input instanceof inputClass) {
|
||||
matchingDescriptors.push(editor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue