From 18f810a8659ea257c28d81b17aa3664f3d6f43e6 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 18 May 2015 21:46:50 +0200 Subject: 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. --- Source/cmListFileCache.cxx | 9 +++++---- 1 file 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; } -- cgit v0.12