summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-05-18 19:46:50 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-05-18 21:55:43 (GMT)
commit18f810a8659ea257c28d81b17aa3664f3d6f43e6 (patch)
treee223310153180ccf25cc95222543783ff6f1912f
parente96b5d14f9f3500b2221e9afedfacabb0a56bb4c (diff)
downloadCMake-18f810a8659ea257c28d81b17aa3664f3d6f43e6.zip
CMake-18f810a8659ea257c28d81b17aa3664f3d6f43e6.tar.gz
CMake-18f810a8659ea257c28d81b17aa3664f3d6f43e6.tar.bz2
cmListFileContext: Sort by line before file.
This should be much faster. In the context where it is used the line comparison should be sufficient, removing the need to compare files at all.
-rw-r--r--Source/cmListFileCache.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index d8d339a..650e2e5 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -434,8 +434,9 @@ std::ostream& operator<<(std::ostream& os, cmListFileContext const& lfc)
bool operator<(const cmListFileContext& lhs, const cmListFileContext& rhs)
{
- if(lhs.FilePath != rhs.FilePath)
- return lhs.FilePath < rhs.FilePath;
-
- return lhs.Line < rhs.Line;
+ if(lhs.Line != rhs.Line)
+ {
+ return lhs.Line < rhs.Line;
+ }
+ return lhs.FilePath < rhs.FilePath;
}