diff options
author | Brad King <brad.king@kitware.com> | 2016-08-23 13:00:00 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-08-23 13:00:00 (GMT) |
commit | 797f7ad87d6f1b6dd7cbbb553d5525ac8ee390f1 (patch) | |
tree | f5922b06caf987f6faff13f8c2ba8e0f164457f6 /Source/cmFileTimeComparison.cxx | |
parent | 762131fe8d585ced6b259a451ccde8fded2a8ca4 (diff) | |
parent | 7b6349da4dc968691f1a374211fcc153c8b4f1c6 (diff) | |
download | CMake-797f7ad87d6f1b6dd7cbbb553d5525ac8ee390f1.zip CMake-797f7ad87d6f1b6dd7cbbb553d5525ac8ee390f1.tar.gz CMake-797f7ad87d6f1b6dd7cbbb553d5525ac8ee390f1.tar.bz2 |
Merge topic 'else-after-return'
7b6349da CMake: don't use else after return
50ad1e0a CTest: don't use else after return
7f97a6c9 CPack: don't use else after return
4988b914 CursesDialog: don't use else after return
Diffstat (limited to 'Source/cmFileTimeComparison.cxx')
-rw-r--r-- | Source/cmFileTimeComparison.cxx | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx index 9d63505..1360b44 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; } |