Optimized TiffMappingInfo::operator==().

This commit is contained in:
Andreas Huggel 2010-01-03 15:20:13 +00:00
parent c5b1793ef7
commit 259a4bb2bf

View File

@ -45,6 +45,7 @@ EXIV2_RCSID("@(#) $Id$")
// + standard includes
#include <string>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <algorithm>
@ -180,8 +181,8 @@ namespace Exiv2 {
bool TiffMappingInfo::operator==(const TiffMappingInfo::Key& key) const
{
std::string make(make_);
return ("*" == make || make == key.m_.substr(0, make.length()))
return ( 0 == strcmp("*", make_)
|| 0 == strncmp(make_, key.m_.c_str(), strlen(make_)))
&& (Tag::all == extendedTag_ || key.e_ == extendedTag_)
&& key.g_ == group_;
}