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.
This commit is contained in:
Stephen Kelly 2015-05-18 21:46:50 +02:00
parent e96b5d14f9
commit 18f810a865
1 changed files with 5 additions and 4 deletions

View File

@ -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;
if(lhs.Line != rhs.Line)
{
return lhs.Line < rhs.Line;
}
return lhs.FilePath < rhs.FilePath;
}