Remove a strlen() call in CFX_FolderFontInfo::FindFont().
There is no need to repeatedly calculate it in a loop, as another
variable already has the answer.
Change-Id: Icbc62150995c420cc66a3b4aae8d6b240c65bc0b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/75372
Reviewed-by: Hui Yingst <nigi@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxge/cfx_folderfontinfo.cpp b/core/fxge/cfx_folderfontinfo.cpp
index 67ec1fb..787bbee 100644
--- a/core/fxge/cfx_folderfontinfo.cpp
+++ b/core/fxge/cfx_folderfontinfo.cpp
@@ -328,11 +328,9 @@
if (bMatchName && !FindFamilyNameMatch(bsFamily, bsName))
continue;
- size_t familyNameLength = strlen(family);
- size_t bsNameLength = bsName.GetLength();
int32_t iSimilarValue =
GetSimilarValue(weight, bItalic, pitch_family, pFont->m_Styles,
- bMatchName, familyNameLength, bsNameLength);
+ bMatchName, bsFamily.GetLength(), bsName.GetLength());
if (iSimilarValue > iBestSimilar) {
iBestSimilar = iSimilarValue;
pFind = pFont;