summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-13 06:33:15 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-13 06:33:15 -0700
commitbb8935e9def5ad865be613eebea597a77fc7c547 (patch)
treef78b7aa57a53d88543f3d8f2b8d843456c5b5df5
parentf786c267e290c259b38afe900b8abd23812a575b (diff)
downloadpdfium-bb8935e9def5ad865be613eebea597a77fc7c547.tar.xz
Get rid of memcmp in CFieldTree::Lookup()
Wide strings compare just fine on their own. Review-Url: https://codereview.chromium.org/2331233002
-rw-r--r--core/fpdfdoc/cpdf_interform.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index d567e09e82..0ebf4460cf 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -634,11 +634,8 @@ CFieldTree::Node* CFieldTree::Lookup(Node* pParent,
for (int i = 0; i < pParent->children.GetSize(); i++) {
Node* pNode = pParent->children[i];
- if (pNode->short_name.GetLength() == short_name.GetLength() &&
- FXSYS_memcmp(pNode->short_name.c_str(), short_name.c_str(),
- short_name.GetLength() * sizeof(FX_WCHAR)) == 0) {
+ if (pNode->short_name == short_name)
return pNode;
- }
}
return nullptr;
}