summaryrefslogtreecommitdiffstats
path: root/src/qdoc/editdistance.cpp
diff options
context:
space:
mode:
authorPaul Wicking <paul.wicking@qt.io>2019-08-07 20:37:57 +0200
committerPaul Wicking <paul.wicking@qt.io>2019-08-08 07:23:16 +0200
commit455bda44cb83b622fddd5954bf27c61a99bf2eba (patch)
tree6df4dd58025ba85e6baa39fa3bb819dba3aa1eca /src/qdoc/editdistance.cpp
parent000f678697fcc8c5512f4ae96c2a49eea9ba8066 (diff)
QDoc: Clean up whitespace
Ensure that QDoc conforms to Qt style, whitespace edition. For the most part, the change involves moving the pointer operators. Also remove whitespace following an opening parenthesis, or immediately preceding a closing one. In some cases, adjust the following line accordingly in methods that span multiple lines. Change-Id: I56ae125a2acf09c669c0a73dc814d05f13575f39 Reviewed-by: Martin Smith <martin.smith@qt.io>
Diffstat (limited to 'src/qdoc/editdistance.cpp')
-rw-r--r--src/qdoc/editdistance.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qdoc/editdistance.cpp b/src/qdoc/editdistance.cpp
index aa7e16b3f..4731fbbdc 100644
--- a/src/qdoc/editdistance.cpp
+++ b/src/qdoc/editdistance.cpp
@@ -34,7 +34,7 @@
QT_BEGIN_NAMESPACE
-int editDistance( const QString& s, const QString& t )
+int editDistance(const QString &s, const QString &t)
{
#define D( i, j ) d[(i) * n + (j)]
int i;
@@ -66,7 +66,7 @@ int editDistance( const QString& s, const QString& t )
#undef D
}
-QString nearestName( const QString& actual, const QSet<QString>& candidates )
+QString nearestName(const QString &actual, const QSet<QString> &candidates)
{
if (actual.isEmpty())
return QString();
@@ -76,22 +76,22 @@ QString nearestName( const QString& actual, const QSet<QString>& candidates )
QString best;
QSet<QString>::ConstIterator c = candidates.constBegin();
- while ( c != candidates.constEnd() ) {
- if ( (*c)[0] == actual[0] ) {
- int delta = editDistance( actual, *c );
- if ( delta < deltaBest ) {
+ while (c != candidates.constEnd()) {
+ if ((*c)[0] == actual[0]) {
+ int delta = editDistance(actual, *c);
+ if (delta < deltaBest) {
deltaBest = delta;
numBest = 1;
best = *c;
- } else if ( delta == deltaBest ) {
+ } else if (delta == deltaBest) {
numBest++;
}
}
++c;
}
- if ( numBest == 1 && deltaBest <= 2 &&
- actual.length() + best.length() >= 5 ) {
+ if (numBest == 1 && deltaBest <= 2 &&
+ actual.length() + best.length() >= 5) {
return best;
} else {
return QString();