From 634ce43cbb9a2aff37e3988a533068ce2d34adfd Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 11 Jan 2025 21:43:43 -0800 Subject: [PATCH] replace strcmp with rfind. Signed-off-by: Rosen Penev --- src/tags.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tags.cpp b/src/tags.cpp index 2426c0bcfc..5b1c4ce161 100644 --- a/src/tags.cpp +++ b/src/tags.cpp @@ -46,9 +46,7 @@ constexpr SectionInfo sectionInfo[] = { namespace Exiv2::Internal { bool TagVocabulary::operator==(const std::string& key) const { - if (strlen(voc_) > key.size()) - return false; - return 0 == strcmp(voc_, key.c_str() + key.size() - strlen(voc_)); + return key.rfind(voc_) != std::string::npos; } // Unknown Tag