summaryrefslogtreecommitdiff
path: root/Source/cmFileTimeComparison.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmFileTimeComparison.cxx')
-rw-r--r--Source/cmFileTimeComparison.cxx27
1 files changed, 14 insertions, 13 deletions
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx
index 9d6350528e..1360b44b4f 100644
--- a/Source/cmFileTimeComparison.cxx
+++ b/Source/cmFileTimeComparison.cxx
@@ -140,11 +140,14 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1,
// Compare using nanosecond resolution.
if (s1->st_mtim.tv_sec < s2->st_mtim.tv_sec) {
return -1;
- } else if (s1->st_mtim.tv_sec > s2->st_mtim.tv_sec) {
+ }
+ if (s1->st_mtim.tv_sec > s2->st_mtim.tv_sec) {
return 1;
- } else if (s1->st_mtim.tv_nsec < s2->st_mtim.tv_nsec) {
+ }
+ if (s1->st_mtim.tv_nsec < s2->st_mtim.tv_nsec) {
return -1;
- } else if (s1->st_mtim.tv_nsec > s2->st_mtim.tv_nsec) {
+ }
+ if (s1->st_mtim.tv_nsec > s2->st_mtim.tv_nsec) {
return 1;
}
#elif CMake_STAT_HAS_ST_MTIMESPEC
@@ -185,11 +188,11 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1,
long long t2 = s2->st_mtim.tv_sec * bil + s2->st_mtim.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;
#elif CMake_STAT_HAS_ST_MTIMESPEC
// Times are integers in units of 1ns.
long long bil = 1000000000;
@@ -240,11 +243,10 @@ bool cmFileTimeComparisonInternal::FileTimeCompare(const char* f1,
// Compare the two modification times.
*result = this->Compare(&s1, &s2);
return true;
- } else {
- // No comparison available. Default to the same time.
- *result = 0;
- return false;
}
+ // No comparison available. Default to the same time.
+ *result = 0;
+ return false;
}
bool cmFileTimeComparisonInternal::FileTimesDiffer(const char* f1,
@@ -256,8 +258,7 @@ bool cmFileTimeComparisonInternal::FileTimesDiffer(const char* f1,
if (this->Stat(f1, &s1) && this->Stat(f2, &s2)) {
// Compare the two modification times.
return this->TimesDiffer(&s1, &s2);
- } else {
- // No comparison available. Default to different times.
- return true;
}
+ // No comparison available. Default to different times.
+ return true;
}