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:
Marc Mutz 2022-10-14 23:44:03 +02:00
parent fc76767692
commit 4af721dec1

View File

@ -3493,9 +3493,7 @@ static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &err
switch (errorCode) {
case QUrlPrivate::NoError:
Q_ASSERT_X(false, "QUrl::errorString",
"Impossible: QUrl::errorString should have treated this condition");
Q_UNREACHABLE_RETURN(QString());
Q_UNREACHABLE_RETURN(QString()); // QUrl::errorString should have treated this condition
case QUrlPrivate::InvalidSchemeError: {
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 '/'");
}
Q_ASSERT_X(false, "QUrl::errorString", "Cannot happen, unknown error");
Q_UNREACHABLE_RETURN(QString());
}