FreeType: reduce allocations in computeFaceIndex

Change-Id: I6693f14b38be7d4fa09378674bcf5da1883608a4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
bb10
Anton Kudryavtsev 2024-03-14 20:04:37 +03:00
parent 91f8d1de37
commit 2d6c4b5ee7
1 changed files with 2 additions and 2 deletions

View File

@ -420,12 +420,12 @@ static int computeFaceIndex(const QString &faceFileName, const QString &styleNam
break;
}
QString faceStyleName = QString::fromLatin1(face->style_name);
const bool found = QLatin1StringView(face->style_name) == styleName;
numFaces = face->num_faces;
FT_Done_Face(face);
if (faceStyleName == styleName)
if (found)
return faceIndex;
} while (++faceIndex < numFaces);