From d3ece0fcc2b1fd60690bf7b6d04ad90c4eb48c0e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 12 Aug 2021 15:09:26 +0200 Subject: [PATCH] QLibrary: remove dead check The variable `i` is initially `suffixPos + 1` and is then incremented further. It therefore can never be equal to `suffixPos` (ints don't overflow, that would be UB, and suffixPos doesn't change its value), so don't check for that. Change-Id: I3870ddf6ee550cad6c24fececf2a0b662a33d750 Reviewed-by: Thiago Macieira --- src/corelib/plugin/qlibrary.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 79a6cfcdf2..67df0a31a6 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -707,8 +707,7 @@ bool QLibrary::isLibrary(const QString &fileName) bool valid = suffixPos != -1; for (int i = suffixPos + 1; i < suffixes.count() && valid; ++i) - if (i != suffixPos) - (void)suffixes.at(i).toInt(&valid); + (void)suffixes.at(i).toInt(&valid); return valid; #endif }