Selaa lähdekoodia

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.
Stephen Kelly 10 vuotta sitten
vanhempi
sitoutus
18f810a865
1 muutettua tiedostoa jossa 5 lisäystä ja 4 poistoa
  1. 5 4
      Source/cmListFileCache.cxx

+ 5 - 4
Source/cmListFileCache.cxx

@@ -434,8 +434,9 @@ std::ostream& operator<<(std::ostream& os, cmListFileContext const& lfc)
 
 
 bool operator<(const cmListFileContext& lhs, const cmListFileContext& rhs)
 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;
 }
 }