Skip to content

Commit 1546f60

Browse files
committed
use early return
1 parent 84510eb commit 1546f60

File tree

1 file changed

+8
-3
lines changed
  • Framework/Core/include/Framework

1 file changed

+8
-3
lines changed

Framework/Core/include/Framework/ASoA.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,11 +2024,16 @@ ColumnGetterFunction<R, T> createGetterPtr(const std::string_view& columnLabel)
20242024
{
20252025
// allows user to use consistent formatting (with prefix) of all column labels
20262026
// by default there isn't 'f' prefix for dynamic column labels
2027-
bool isPrefixMatch = columnLabel.size() > 1 && columnLabel.substr(1) == C::columnLabel();
2027+
if(columnLabel.size() > 1 && columnLabel.substr(1) == C::columnLabel()) {
2028+
return &getColumnValue<R, T, C>;
2029+
}
2030+
20282031
// check also exact match if user is aware of prefix missing
2029-
bool isExactMatch = columnLabel == C::columnLabel();
2032+
if(columnLabel == C::columnLabel()) {
2033+
return &getColumnValue<R, T, C>;
2034+
}
20302035

2031-
return (isPrefixMatch || isExactMatch) ? &getColumnValue<R, T, C> : nullptr;
2036+
return nullptr;
20322037
}
20332038

20342039
template <typename R, typename T, typename... Cs>

0 commit comments

Comments
 (0)