Remove an unnecessary check and an unnecessary temporary.
authorMikhail Glushenkov <foldr@codedgers.com>
Thu, 28 Oct 2010 19:33:04 +0000 (19:33 +0000)
committerMikhail Glushenkov <foldr@codedgers.com>
Thu, 28 Oct 2010 19:33:04 +0000 (19:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117583 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/SystemUtils.cpp

index c8b260c2e3dd9b4174fa224c9e124b0a11b2c5e7..820e7cfbb17cfce79fd98b4edd02d95df4e0d7fd 100644 (file)
@@ -56,10 +56,9 @@ sys::Path llvm::FindExecutable(const std::string &ExeName,
     // version of the program.
     if (Result.isAbsolute()) {
       Result = sys::Program::FindProgramByName(Result.str());
-      if (!Result.empty())
-        return Result;
+      return Result;
     }
   }
 
-  return sys::Path();
+  return Result;
 }