From 4af721dec18e61e5d57a452fbf2b2b52cdb193d8 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 14 Oct 2022 23:44:03 +0200 Subject: [PATCH] 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 --- src/corelib/io/qurl.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 591ed7fe87..4be07bcb0f 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -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()); }