Skip to content

Commit

Permalink
Some more cppcheck fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthaf committed May 27, 2024
1 parent b6bf849 commit dd85ec8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/metatensor/metatensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,10 @@ MetatensorPlumedAction::MetatensorPlumedAction(const ActionOptions& options):
// Now that we now both n_samples and n_properties, we can setup the
// PLUMED-side storage for the computed CV
if (output->per_atom) {
auto selected_atoms = this->evaluations_options_->get_selected_atoms();
if (selected_atoms.has_value()) {
this->n_samples_ = static_cast<unsigned>(selected_atoms.value()->count());
} else {
if (selected_atoms.empty()) {
this->n_samples_ = static_cast<unsigned>(this->atomic_types_.size(0));
} else {
this->n_samples_ = static_cast<unsigned>(selected_atoms.size());
}
} else {
this->n_samples_ = 1;
Expand Down Expand Up @@ -746,7 +745,7 @@ void MetatensorPlumedAction::calculate() {
}

void MetatensorPlumedAction::apply() {
auto* value = this->getPntrToComponent(0);
const auto* value = this->getPntrToComponent(0);
if (!value->forcesWereAdded()) {
return;
}
Expand Down

0 comments on commit dd85ec8

Please sign in to comment.