提交 e5e29375 编写于 作者: M Matt Bierner

Remove extra conditional

上级 47e54aef
......@@ -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;
// 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;
}
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;
}
// Normal instanceof check
else if (byInstanceOf && input instanceof inputClass) {
matchingDescriptors.push(editor);
break;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册