summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-07-23 13:06:48 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-07-23 13:06:48 (GMT)
commitdddbad259c5d497987cbb367ce184f3953f2f137 (patch)
tree76ce09dea60fff3d5523dc47e4dc2d39b1410b43 /Source/kwsys
parent21c14ca2bca12e90ded1be354bc48e9d98acc643 (diff)
downloadCMake-dddbad259c5d497987cbb367ce184f3953f2f137.zip
CMake-dddbad259c5d497987cbb367ce184f3953f2f137.tar.gz
CMake-dddbad259c5d497987cbb367ce184f3953f2f137.tar.bz2
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
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/SystemTools.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 959f6fc..9476764 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -1344,8 +1344,7 @@ void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path)
}
// 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,