[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kdecore/io
From: Albert Astals Cid <tsdgeos () terra ! es>
Date: 2010-09-12 15:06:56
Message-ID: 20100912150656.AB575AC887 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1174482 by aacid:
Add some more missing QLatin1Char and a const
1% speed increase
M +5 -5 kurl.cpp
--- trunk/KDE/kdelibs/kdecore/io/kurl.cpp #1174481:1174482
@@ -72,7 +72,7 @@
}
}
- bool slash = (len && path[len-1] == QLatin1Char('/')) ||
+ const bool slash = (len && path[len-1] == QLatin1Char('/')) ||
(len > 1 && path[len-2] == QLatin1Char('/') && path[len-1] == QLatin1Char('.'));
// The following code cleans up directory path much like
@@ -89,14 +89,14 @@
while ( pos && (pos = path.lastIndexOf(QLatin1Char('/'),--pos)) != -1 )
{
len = orig_pos - pos - 1;
- if ( len == 2 && path[pos+1] == '.' && path[pos+2] == '.' )
+ if ( len == 2 && path[pos+1] == QLatin1Char('.') && path[pos+2] == QLatin1Char('.') )
cdUp++;
else
{
// Ignore any occurrences of '.'
// This includes entries that simply do not make sense like /..../
if ( (len || !cleanDirSeparator) &&
- (len != 1 || path[pos+1] != '.' ) )
+ (len != 1 || path[pos+1] != QLatin1Char('.') ) )
{
if ( !cdUp )
result.prepend(path.mid(pos, len+1));
@@ -114,9 +114,9 @@
#endif
if ( result.isEmpty() )
- result = '/';
+ result = QLatin1Char('/');
else if ( slash && result[result.length()-1] != QLatin1Char('/') )
- result.append(QChar('/'));
+ result.append(QLatin1Char('/'));
return result;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic