Skip to content

Commit

Permalink
use early return
Browse files Browse the repository at this point in the history
  • Loading branch information
mytkom committed Nov 15, 2024
1 parent 84510eb commit 1546f60
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Framework/Core/include/Framework/ASoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -2024,11 +2024,16 @@ ColumnGetterFunction<R, T> createGetterPtr(const std::string_view& columnLabel)
{
// allows user to use consistent formatting (with prefix) of all column labels
// by default there isn't 'f' prefix for dynamic column labels
bool isPrefixMatch = columnLabel.size() > 1 && columnLabel.substr(1) == C::columnLabel();
if(columnLabel.size() > 1 && columnLabel.substr(1) == C::columnLabel()) {
return &getColumnValue<R, T, C>;
}

// check also exact match if user is aware of prefix missing
bool isExactMatch = columnLabel == C::columnLabel();
if(columnLabel == C::columnLabel()) {
return &getColumnValue<R, T, C>;
}

return (isPrefixMatch || isExactMatch) ? &getColumnValue<R, T, C> : nullptr;
return nullptr;
}

template <typename R, typename T, typename... Cs>
Expand Down

0 comments on commit 1546f60

Please sign in to comment.