From a837df85908bdf5b00fa6d328dd622b59b91ef8b Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Fri, 6 Nov 2015 15:19:53 -0800 Subject: [PATCH] adb: remove superfluous checks. Change-Id: I4d9ceb301b0d242b0bad9a0faa8e2a1824f36cca --- adb/file_sync_client.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/adb/file_sync_client.cpp b/adb/file_sync_client.cpp index 44f3cfd78..7e9f605f0 100644 --- a/adb/file_sync_client.cpp +++ b/adb/file_sync_client.cpp @@ -545,9 +545,7 @@ static bool copy_local_dir_remote(SyncConnection& sc, std::string lpath, std::string rpath, bool check_timestamps, bool list_only) { // Make sure that both directory paths end in a slash. - if (lpath.empty() || rpath.empty()) { - return false; - } + // Both paths are known to exist, so they cannot be empty. if (lpath.back() != '/') { lpath.push_back('/'); } @@ -717,9 +715,7 @@ static int set_time_and_mode(const char *lpath, time_t time, unsigned int mode) static bool copy_remote_dir_local(SyncConnection& sc, std::string rpath, std::string lpath, bool copy_attrs) { // Make sure that both directory paths end in a slash. - if (rpath.empty() || lpath.empty()) { - return false; - } + // Both paths are known to exist, so they cannot be empty. if (rpath.back() != '/') { rpath.push_back('/'); }