QUrl: remove two unneeded Q_ASSERT()s
Q_UNREACHABLE/_RETURN() already contain such an assertion, we don't need two of them. Copy additional bits of information, if any, from the manual assertion into a code comment. Change-Id: I141b65d1293abf581272b2457015d4e52395d08b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
fc76767692
commit
4af721dec1
@ -3493,9 +3493,7 @@ static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &err
|
|||||||
|
|
||||||
switch (errorCode) {
|
switch (errorCode) {
|
||||||
case QUrlPrivate::NoError:
|
case QUrlPrivate::NoError:
|
||||||
Q_ASSERT_X(false, "QUrl::errorString",
|
Q_UNREACHABLE_RETURN(QString()); // QUrl::errorString should have treated this condition
|
||||||
"Impossible: QUrl::errorString should have treated this condition");
|
|
||||||
Q_UNREACHABLE_RETURN(QString());
|
|
||||||
|
|
||||||
case QUrlPrivate::InvalidSchemeError: {
|
case QUrlPrivate::InvalidSchemeError: {
|
||||||
auto msg = "Invalid scheme (character '%1' not permitted)"_L1;
|
auto msg = "Invalid scheme (character '%1' not permitted)"_L1;
|
||||||
@ -3552,7 +3550,6 @@ static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &err
|
|||||||
return QStringLiteral("Relative URL's path component contains ':' before any '/'");
|
return QStringLiteral("Relative URL's path component contains ':' before any '/'");
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_ASSERT_X(false, "QUrl::errorString", "Cannot happen, unknown error");
|
|
||||||
Q_UNREACHABLE_RETURN(QString());
|
Q_UNREACHABLE_RETURN(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user