[llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Feb 15 14:01:58 PST 2005



Changes in directory llvm/lib/Support:

FileUtilities.cpp updated: 1.41 -> 1.42
---
Log message:

Make this more efficient now that we know both files are the same length.


---
Diffs of the changes:  (+2 -2)

 FileUtilities.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/Support/FileUtilities.cpp
diff -u llvm/lib/Support/FileUtilities.cpp:1.41 llvm/lib/Support/FileUtilities.cpp:1.42
--- llvm/lib/Support/FileUtilities.cpp:1.41	Tue Feb 15 15:59:53 2005
+++ llvm/lib/Support/FileUtilities.cpp	Tue Feb 15 16:01:43 2005
@@ -148,11 +148,11 @@
 
     if (A_size == B_size) {
       // Scan for the end of file or first difference.
-      while (F1P < File1End && F2P < File2End && *F1P == *F2P)
+      while (F1P < File1End && *F1P == *F2P)
         ++F1P, ++F2P;
 
       // Common case: identifical files.
-      if (F1P == File1End && F2P == File2End) 
+      if (F1P == File1End)
         return 0; // Scanned to end, files same
 
       if (AbsTol == 0 && RelTol == 0)






More information about the llvm-commits mailing list