Skip to content

Commit 84555f1

Browse files
committed
clang-tidy: no else after return
Signed-off-by: Rosen Penev <[email protected]>
1 parent c2be021 commit 84555f1

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

app/exiv2.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -749,9 +749,8 @@ int Params::evalDelete(const std::string& optArg) {
749749
if (rc > 0) {
750750
target_ |= static_cast<CommonTarget>(rc);
751751
return 0;
752-
} else {
753-
return 1;
754752
}
753+
return 1;
755754
}
756755
default:
757756
std::cerr << progname() << ": " << _("Option -d is not compatible with a previous option\n");
@@ -771,9 +770,8 @@ int Params::evalExtract(const std::string& optArg) {
771770
if (rc > 0) {
772771
target_ |= static_cast<CommonTarget>(rc);
773772
return 0;
774-
} else {
775-
return 1;
776773
}
774+
return 1;
777775
}
778776
default:
779777
std::cerr << progname() << ": " << _("Option -e is not compatible with a previous option\n");
@@ -793,9 +791,8 @@ int Params::evalInsert(const std::string& optArg) {
793791
if (rc > 0) {
794792
target_ |= static_cast<CommonTarget>(rc);
795793
return 0;
796-
} else {
797-
return 1;
798794
}
795+
return 1;
799796
}
800797
default:
801798
std::cerr << progname() << ": " << _("Option -i is not compatible with a previous option\n");

src/types.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ byte* Exiv2::DataBuf::data(size_t offset) {
178178
const byte* Exiv2::DataBuf::c_data(size_t offset) const {
179179
if (pData_.empty()) {
180180
return nullptr;
181-
} else if (offset >= pData_.size()) {
181+
}
182+
if (offset >= pData_.size()) {
182183
throw std::out_of_range("Overflow in Exiv2::DataBuf::c_data");
183184
}
184185
return &pData_[offset];

0 commit comments

Comments
 (0)