replace switch with if/return
Fixes warning C4702: unreachable code No other way to make all compilers gappy. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
dde8765a49
commit
d2ddf228ad
@ -733,19 +733,15 @@ AccessMode ImageFactory::checkMode(ImageType type, MetadataId metadataId) {
|
|||||||
auto r = Exiv2::find(registry, type);
|
auto r = Exiv2::find(registry, type);
|
||||||
if (!r)
|
if (!r)
|
||||||
throw Error(ErrorCode::kerUnsupportedImageType, static_cast<int>(type));
|
throw Error(ErrorCode::kerUnsupportedImageType, static_cast<int>(type));
|
||||||
switch (metadataId) {
|
if (metadataId == mdExif)
|
||||||
case mdExif:
|
return r->exifSupport_;
|
||||||
return r->exifSupport_;
|
if (metadataId == mdIptc)
|
||||||
case mdIptc:
|
return r->iptcSupport_;
|
||||||
return r->iptcSupport_;
|
if (metadataId == mdXmp)
|
||||||
case mdXmp:
|
return r->xmpSupport_;
|
||||||
return r->xmpSupport_;
|
if (metadataId == mdComment)
|
||||||
case mdComment:
|
return r->commentSupport_;
|
||||||
return r->commentSupport_;
|
return amNone;
|
||||||
default:
|
|
||||||
return amNone;
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImageFactory::checkType(ImageType type, BasicIo& io, bool advance) {
|
bool ImageFactory::checkType(ImageType type, BasicIo& io, bool advance) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user