clang-tidy: don't use else after return/throw

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2022-03-07 14:41:06 -08:00
parent 9f949195e4
commit b6bdbf5574
2 changed files with 6 additions and 3 deletions

View File

@ -58,7 +58,8 @@ try {
std::vector<std::regex> keys;
Exiv2::dumpLibraryInfo(std::cout,keys);
return rc;
} else if ( strcmp(file,"--version-test") == 0 ) {
}
if (strcmp(file, "--version-test") == 0) {
// verifies/test macro EXIV2_TEST_VERSION
// described in include/exiv2/version.hpp
std::cout << "EXV_PACKAGE_VERSION " << EXV_PACKAGE_VERSION << std::endl

View File

@ -199,7 +199,8 @@ namespace Exiv2 {
/// \todo this first check should be for <= offset
if (pData_.size() < offset) {
throw std::overflow_error("Overflow in Exiv2::DataBuf::c_data");
} else if (pData_.empty() || pData_.size() == offset) {
}
if (pData_.empty() || pData_.size() == offset) {
return nullptr;
}
return &pData_[offset];
@ -209,7 +210,8 @@ namespace Exiv2 {
/// \todo this first check should be for <= offset
if (pData_.size() < offset) {
throw std::overflow_error("Overflow in Exiv2::DataBuf::c_data");
} else if (pData_.empty() || pData_.size() == offset) {
}
if (pData_.empty() || pData_.size() == offset) {
return nullptr;
}
return &pData_[offset];