瀏覽代碼

Kernel: Use StringView::to_uint instead of String::to_uint in ProcFS

Idan Horowitz 3 年之前
父節點
當前提交
792b8ca13c
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      Kernel/GlobalProcessExposed.cpp

+ 1 - 2
Kernel/GlobalProcessExposed.cpp

@@ -973,8 +973,7 @@ ErrorOr<NonnullRefPtr<ProcFSExposedComponent>> ProcFSRootDirectory::lookup(Strin
         return maybe_candidate.release_value();
         return maybe_candidate.release_value();
     }
     }
 
 
-    String process_directory_name = name;
-    auto pid = process_directory_name.to_uint<unsigned>();
+    auto pid = name.to_uint<unsigned>();
     if (!pid.has_value())
     if (!pid.has_value())
         return ESRCH;
         return ESRCH;
     auto actual_pid = pid.value();
     auto actual_pid = pid.value();