From 6bfc1aef17cd6af69c0a6aaba4630ec7cebad13f Mon Sep 17 00:00:00 2001
From: Rolf Eike Beer <eike@sf-mail.de>
Date: Thu, 3 Dec 2015 19:16:33 +0100
Subject: [PATCH] SystemTools: do not call FileExists() before calling
 FileIsDirectory()

FileIsDirectory() will return false if the given path does not exist, so the
call to FileExists() is redundant.

Change-Id: I46b3dde9150d6f24a436c4d2f9dd6e2d21c57638
---
 SystemTools.cxx | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/SystemTools.cxx b/SystemTools.cxx
index c23322b..82087f0 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -2402,8 +2402,7 @@ bool SystemTools::CopyFileAlways(const std::string& source, const std::string& d
     // name as the source in that directory.
 
     std::string destination_dir;
-    if(SystemTools::FileExists(destination) &&
-       SystemTools::FileIsDirectory(destination))
+    if(SystemTools::FileIsDirectory(destination))
       {
       destination_dir = real_destination;
       SystemTools::ConvertToUnixSlashes(real_destination);
@@ -3127,8 +3126,7 @@ std::string SystemTools
     tryPath = *p;
     tryPath += name;
     tryPath += ".framework";
-    if(SystemTools::FileExists(tryPath)
-       && SystemTools::FileIsDirectory(tryPath))
+    if(SystemTools::FileIsDirectory(tryPath))
       {
       return SystemTools::CollapseFullPath(tryPath);
       }
-- 
GitLab