소스 검색

LibDesktop: Collapse if-else in AppFile

Jelle Raaijmakers 4 년 전
부모
커밋
0ec39aafb6
1개의 변경된 파일3개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 5
      Userland/Libraries/LibDesktop/AppFile.cpp

+ 3 - 5
Userland/Libraries/LibDesktop/AppFile.cpp

@@ -124,11 +124,9 @@ bool AppFile::spawn() const
     if ((errno = posix_spawn(&child_pid, executable().characters(), nullptr, nullptr, const_cast<char**>(argv), environ))) {
         perror("posix_spawn");
         return false;
-    } else {
-        if (disown(child_pid) < 0) {
-            perror("disown");
-            return false;
-        }
+    } else if (disown(child_pid) < 0) {
+        perror("disown");
+        return false;
     }
 
     return true;