Skip to content

Commit e56e296

Browse files
committed
follow clang-tidy suggestions
1 parent 5d7e314 commit e56e296

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

infra/GenericContainerFiller.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct FICS {// FICS stands for float, int, char, short
2727
char char_{static_cast<char>(-199)};
2828
short short_{static_cast<short>(-199)};
2929

30-
float get() {
30+
float get() const {
3131
if (std::fabs(float_ + 199.f) > 1e-4) return float_;
3232
if (int_ != -199) return static_cast<float>(int_);
3333
if (char_ != static_cast<char>(-199)) return static_cast<float>(char_);
@@ -83,7 +83,7 @@ class GenericContainerFiller {
8383
std::vector<FICS> branch_values_;
8484

8585
// variable, change of value of which triggers switch to a new AT event
86-
std::string entry_switch_trigger_var_name_{""};
86+
std::string entry_switch_trigger_var_name_;
8787

8888
int entry_switch_trigger_id_{-1};
8989

infra/PlainTreeFiller.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void PlainTreeFiller::AddBranch(const std::string& branch_name) {
1616
}
1717

1818
void PlainTreeFiller::SetFieldsToIgnore(const std::vector<std::string>& fields_to_ignore) {
19-
if (branch_name_ == "") {
19+
if (branch_name_.empty()) {
2020
throw std::runtime_error("PlainTreeFiller::SetFieldsToIgnore() must be called after PlainTreeFiller::AddBranch()\n");
2121
}
2222
for (auto& fti : fields_to_ignore) {
@@ -25,7 +25,7 @@ void PlainTreeFiller::SetFieldsToIgnore(const std::vector<std::string>& fields_t
2525
}
2626

2727
void PlainTreeFiller::SetFieldsToPreserve(const std::vector<std::string>& fields_to_preserve) {
28-
if (branch_name_ == "") {
28+
if (branch_name_.empty()) {
2929
throw std::runtime_error("PlainTreeFiller::SetFieldsToPreserve() must be called after PlainTreeFiller::AddBranch()\n");
3030
}
3131
for (auto& fti : fields_to_preserve) {
@@ -44,7 +44,7 @@ void PlainTreeFiller::Init() {
4444
if (me.second.id_ < 0) defaultFieldsNames.emplace_back(me.first);
4545
}
4646
}
47-
SetFieldsToIgnore(std::move(defaultFieldsNames));
47+
SetFieldsToIgnore(defaultFieldsNames);
4848
}
4949

5050
if (!fields_to_ignore_.empty() && !fields_to_preserve_.empty()) {
@@ -55,17 +55,17 @@ void PlainTreeFiller::Init() {
5555
const auto& branch_config = config_->GetBranchConfig(branch_name_);
5656
for (const auto& field : branch_config.GetMap<float>()) {
5757
AnalysisTask::AddEntry(AnalysisEntry({Variable(branch_name_, field.first)}));
58-
vars_.emplace_back(FIB());
58+
vars_.emplace_back();
5959
vars_.back().type_ = Types::kFloat;
6060
}
6161
for (const auto& field : branch_config.GetMap<int>()) {
6262
AnalysisTask::AddEntry(AnalysisEntry({Variable(branch_name_, field.first)}));
63-
vars_.emplace_back(FIB());
63+
vars_.emplace_back();
6464
vars_.back().type_ = Types::kInteger;
6565
}
6666
for (const auto& field : branch_config.GetMap<bool>()) {
6767
AnalysisTask::AddEntry(AnalysisEntry({Variable(branch_name_, field.first)}));
68-
vars_.emplace_back(FIB());
68+
vars_.emplace_back();
6969
vars_.back().type_ = Types::kBool;
7070
}
7171
}

0 commit comments

Comments
 (0)