Don't use 'else' after return/break

This commit is contained in:
thalieht
2019-02-12 20:05:01 +02:00
parent 78ab0e4ba9
commit 8a3f942385
15 changed files with 75 additions and 83 deletions

View File

@@ -178,7 +178,7 @@ QString GeoIPDatabase::lookup(const QHostAddress &hostAddr) const
if (id == m_nodeCount) {
return QString();
}
else if (id > m_nodeCount) {
if (id > m_nodeCount) {
QString country = m_countries.value(id);
if (country.isEmpty()) {
const quint32 offset = id - m_nodeCount - sizeof(DATA_SECTION_SEPARATOR);
@@ -191,9 +191,8 @@ QString GeoIPDatabase::lookup(const QHostAddress &hostAddr) const
}
return country;
}
else {
ptr = m_data + (id * m_nodeSize);
}
ptr = m_data + (id * m_nodeSize);
}
}
@@ -205,7 +204,7 @@ if (!metadata.contains(#key)) { \
error = errMsgNotFound.arg(#key); \
return false; \
} \
else if (metadata.value(#key).userType() != QMetaType::type) { \
if (metadata.value(#key).userType() != QMetaType::type) { \
error = errMsgInvalid.arg(#key); \
return false; \
}