提交 711eca07 编写于 作者: M Matt Bierner

Remove extra checks that are not needed

上级 e5e29375
......@@ -140,7 +140,7 @@ class EditorRegistry implements IEditorRegistry {
};
const descriptors = findEditorDescriptors(input);
if (descriptors && descriptors.length > 0) {
if (descriptors.length > 0) {
// Ask the input for its preferred Editor
const preferredEditorId = input.getPreferredEditorId(descriptors.map(d => d.getId()));
......
......@@ -381,7 +381,7 @@ export abstract class EditorInput extends Disposable implements IEditorInput {
* for the input. This allows subclasses to decide late which editor to use for the input on a case by case basis.
*/
getPreferredEditorId(candidates: string[]): string | null {
if (candidates && candidates.length > 0) {
if (candidates.length > 0) {
return candidates[0];
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册