diff options
author | Matthias Maennich <matthias@maennich.net> | 2017-09-19 14:19:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-09-28 11:23:42 (GMT) |
commit | 870dd06da15751250786d435ee4c1361a2b10b4d (patch) | |
tree | 3a59f41d841e62356b088c9c82f37153f36c003d /Source/cmFileTimeComparison.cxx | |
parent | 2033abff0dec29072ac070cb6fe1604e8c03f180 (diff) | |
download | CMake-870dd06da15751250786d435ee4c1361a2b10b4d.zip CMake-870dd06da15751250786d435ee4c1361a2b10b4d.tar.gz CMake-870dd06da15751250786d435ee4c1361a2b10b4d.tar.bz2 |
Fix left-over occurrences of else-after-return
Fix issues diagnosed by clang-tidy [readability-else-after-return]
These were mostly only showing up on OSX.
Signed-off-by: Matthias Maennich <matthias@maennich.net>
Diffstat (limited to 'Source/cmFileTimeComparison.cxx')
-rw-r--r-- | Source/cmFileTimeComparison.cxx | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx index 61e419c..622c15e 100644 --- a/Source/cmFileTimeComparison.cxx +++ b/Source/cmFileTimeComparison.cxx @@ -116,18 +116,22 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1, // Compare using nanosecond resolution. if (s1->st_mtimespec.tv_sec < s2->st_mtimespec.tv_sec) { return -1; - } else if (s1->st_mtimespec.tv_sec > s2->st_mtimespec.tv_sec) { + } + if (s1->st_mtimespec.tv_sec > s2->st_mtimespec.tv_sec) { return 1; - } else if (s1->st_mtimespec.tv_nsec < s2->st_mtimespec.tv_nsec) { + } + if (s1->st_mtimespec.tv_nsec < s2->st_mtimespec.tv_nsec) { return -1; - } else if (s1->st_mtimespec.tv_nsec > s2->st_mtimespec.tv_nsec) { + } + if (s1->st_mtimespec.tv_nsec > s2->st_mtimespec.tv_nsec) { return 1; } #else // Compare using 1 second resolution. if (s1->st_mtime < s2->st_mtime) { return -1; - } else if (s1->st_mtime > s2->st_mtime) { + } + if (s1->st_mtime > s2->st_mtime) { return 1; } #endif @@ -162,20 +166,20 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1, long long t2 = s2->st_mtimespec.tv_sec * bil + s2->st_mtimespec.tv_nsec; if (t1 < t2) { return (t2 - t1) >= bil; - } else if (t2 < t1) { + } + if (t2 < t1) { return (t1 - t2) >= bil; - } else { - return false; } + return false; #else // Times are integers in units of 1s. if (s1->st_mtime < s2->st_mtime) { return (s2->st_mtime - s1->st_mtime) >= 1; - } else if (s1->st_mtime > s2->st_mtime) { + } + if (s1->st_mtime > s2->st_mtime) { return (s1->st_mtime - s2->st_mtime) >= 1; - } else { - return false; } + return false; #endif #else // Times are integers in units of 100ns. |