diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-18 19:46:50 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-05-18 21:55:43 (GMT) |
commit | 18f810a8659ea257c28d81b17aa3664f3d6f43e6 (patch) | |
tree | e223310153180ccf25cc95222543783ff6f1912f /Source/cmListFileCache.cxx | |
parent | e96b5d14f9f3500b2221e9afedfacabb0a56bb4c (diff) | |
download | CMake-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.
Diffstat (limited to 'Source/cmListFileCache.cxx')
-rw-r--r-- | Source/cmListFileCache.cxx | 9 |
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; } |