瀏覽代碼

TextEditor/FileArgument: Remove file existance check for early exit

This check was fine earlier when we had access to the full filesystem,
but now that we are moving away from applications having unveiled
access to the filesystem, this check would just get rejected from
the kernel. This is rare / fast enough that performance should not
really matter in any case.
Mustafa Quraish 3 年之前
父節點
當前提交
8378ecc67b
共有 1 個文件被更改,包括 0 次插入6 次删除
  1. 0 6
      Userland/Applications/TextEditor/FileArgument.cpp

+ 0 - 6
Userland/Applications/TextEditor/FileArgument.cpp

@@ -15,12 +15,6 @@ FileArgument::FileArgument(String file_argument)
     m_line = {};
     m_column = {};
 
-    if (Core::File::exists(file_argument)) {
-        // A file exists with the full specified name, don't attempt to parse it.
-        m_filename = move(file_argument);
-        return;
-    }
-
     // A file doesn't exist with the full specified name, maybe the user entered line/column coordinates?
     Regex<PosixExtended> re("^(.+?)(:([0-9]+):?([0-9]+)?)?$");
     RegexResult result = match(file_argument, re, PosixFlags::Global | PosixFlags::Multiline | PosixFlags::Ungreedy);