[cmake-commits] alex committed SystemTools.cxx 1.199 1.200

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Jul 23 09:06:50 EDT 2007


Update of /cvsroot/CMake/CMake/Source/kwsys
In directory public:/mounts/ram/cvs-serv8515/Source/kwsys

Modified Files:
	SystemTools.cxx 
Log Message:

PERF: micro optimization: the (*pos1) && (*pos1=='/') were redundant, and
hasDoubleSlash is false in most cases, so in most cases 3 comparisons were
done, now only one

Alex


Index: SystemTools.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/SystemTools.cxx,v
retrieving revision 1.199
retrieving revision 1.200
diff -u -d -r1.199 -r1.200
--- SystemTools.cxx	6 Jun 2007 14:44:20 -0000	1.199
+++ SystemTools.cxx	23 Jul 2007 13:06:48 -0000	1.200
@@ -1344,8 +1344,7 @@
       }
 
     // Also, reuse the loop to check for slash followed by another slash
-    if ( !hasDoubleSlash && *pos1 &&
-      *pos1 == '/' && *(pos1+1) == '/' )
+    if (*pos1 == '/' && *(pos1+1) == '/' && !hasDoubleSlash)
       {
 #ifdef _WIN32
       // However, on windows if the first characters are both slashes,



More information about the Cmake-commits mailing list