@@ -855,12 +855,9 @@ std::ostream& SonyMakerNote::printSonyMisc3cShotNumberSincePowerUp(std::ostream&
855855 " DSC-RX100M4" , " DSC-RX100M5" , " DSC-WX220" , " DSC-WX350" , " DSC-WX500" ,
856856 };
857857
858- std::string model = pos->toString ();
859- for (auto & m : models) {
860- if (m == model)
861- return os << value.toInt64 ();
862- }
863-
858+ bool f = std::any_of (models.begin (), models.end (), [model = pos->toString ()](auto && m) { return m == model; });
859+ if (f)
860+ return os << value.toInt64 ();
864861 return os << N_ (" n/a" );
865862}
866863
@@ -923,13 +920,11 @@ std::ostream& SonyMakerNote::printSonyMisc3cSonyImageHeight(std::ostream& os, co
923920 if (pos == metadata->end ())
924921 return os << " (" << value << " )" ;
925922
926- std::string model = pos->toString ();
927-
928923 // Models that do not support this tag
929- for ( auto & m : {" ILCE-1" , " ILCE-7SM3" , " ILME-FX3" }) {
930- if (m == model)
931- return os << N_ ( " n/a " );
932- }
924+ const auto models = std::array {" ILCE-1" , " ILCE-7SM3" , " ILME-FX3" };
925+ bool f = std::any_of (models. begin (), models. end (), [model = pos-> toString ()]( auto && m) { return m == model; });
926+ if (f)
927+ return os << N_ ( " n/a " );
933928
934929 const auto val = value.toInt64 ();
935930 return val > 0 ? os << (8 * val) : os << N_ (" n/a" );
@@ -944,13 +939,11 @@ std::ostream& SonyMakerNote::printSonyMisc3cModelReleaseYear(std::ostream& os, c
944939 if (pos == metadata->end ())
945940 return os << " (" << value << " )" ;
946941
947- std::string model = pos->toString ();
948-
949942 // Models that do not support this tag
950- for ( auto & m : {" ILCE-1" , " ILCE-7SM3" , " ILME-FX3" }) {
951- if (m == model)
952- return os << N_ ( " n/a " );
953- }
943+ const auto models = std::array {" ILCE-1" , " ILCE-7SM3" , " ILME-FX3" };
944+ bool f = std::any_of (models. begin (), models. end (), [model = pos-> toString ()]( auto && m) { return m == model; });
945+ if (f)
946+ return os << N_ ( " n/a " );
954947
955948 const auto val = value.toInt64 ();
956949 if (val > 99 )
0 commit comments