Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace strcmp with rfind.
Browse files Browse the repository at this point in the history
Signed-off-by: Rosen Penev <rosenp@gmail.com>
neheb committed Jan 12, 2025
1 parent 275cb13 commit 634ce43
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/tags.cpp
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 634ce43

Please sign in to comment.