summaryrefslogtreecommitdiffstats
path: root/Source/cmFileTimeComparison.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmFileTimeComparison.cxx')
-rw-r--r--Source/cmFileTimeComparison.cxx29
1 files changed, 16 insertions, 13 deletions
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx
index f591a8d..622c15e 100644
--- a/Source/cmFileTimeComparison.cxx
+++ b/Source/cmFileTimeComparison.cxx
@@ -4,10 +4,9 @@
#include <string>
#include <time.h>
+#include <unordered_map>
#include <utility>
-#include "cm_unordered_map.hxx"
-
// Use a platform-specific API to get file times efficiently.
#if !defined(_WIN32) || defined(__CYGWIN__)
#include "cm_sys_stat.h"
@@ -27,7 +26,7 @@ public:
bool FileTimesDiffer(const char* f1, const char* f2);
private:
- typedef CM_UNORDERED_MAP<std::string, cmFileTimeComparison_Type>
+ typedef std::unordered_map<std::string, cmFileTimeComparison_Type>
FileStatsMap;
FileStatsMap Files;
@@ -117,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
@@ -163,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.