Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Tidy January 2024 #1784

Merged
merged 4 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/gui/keywordWidgets/function1DFuncs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ void Function1DKeywordWidget::updateValue(const Flags<DissolveSignals::DataMutat
// Update keyword data based on widget values
void Function1DKeywordWidget::updateKeywordData()
{
// Grab the target Function1D
auto &function = keyword_->data();

// Get current data from widgets
auto func = ui_.FunctionCombo->currentData().value<Functions::Function1D>();
std::vector<double> newParams;
Expand Down
4 changes: 2 additions & 2 deletions src/kernels/energy.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ class EnergyResult
{
public:
EnergyResult(PairPotentialEnergyValue pp = {}, double geom = 0.0, double ext = 0.0)
: total_(pp.total() + geom + ext), pairPotential_(pp), geometry_(geom), extended_(ext){};
: total_(pp.total() + geom + ext), geometry_(geom), extended_(ext), pairPotential_(pp){};

private:
// Components
PairPotentialEnergyValue pairPotential_;
double total_, geometry_, extended_;
PairPotentialEnergyValue pairPotential_;

public:
double total() const { return total_; };
Expand Down
8 changes: 4 additions & 4 deletions src/main/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ bool Dissolve::loadInput(std::string_view filename)
deserialise(contents);
return true;
}
catch (toml::syntax_error e)
catch (toml::syntax_error &e)
{
Messenger::error("Syntax error in TOML file (are you sure you meant the .toml extension?).\n\n{}", e.what());
}
catch (toml::type_error e)
catch (toml::type_error &e)
{
Messenger::error("Could not load TOML file\n\n{}", e.what());
}
Expand All @@ -262,7 +262,7 @@ bool Dissolve::loadInput(std::string_view filename)
deserialise(contents);
return true;
}
catch (toml::syntax_error e)
catch (toml::syntax_error &e)
{
// The file didn't have TOML syntax, so try the original parser
// Open file and check that we're OK to proceed reading from it
Expand All @@ -279,7 +279,7 @@ bool Dissolve::loadInput(std::string_view filename)

return result;
}
catch (toml::type_error e)
catch (toml::type_error &e)
{
// The file *was* a TOML file, but it had problems loading
Messenger::error("Could not load TOML file\n\n{}", e.what());
Expand Down
6 changes: 3 additions & 3 deletions src/procedure/nodes/operateNumberDensityNormalise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ OperateNumberDensityNormaliseProcedureNode::OperateNumberDensityNormaliseProcedu
// Operate on Data1D target
bool OperateNumberDensityNormaliseProcedureNode::operateData1D(const ProcessPool &procPool, Configuration *cfg)
{
for (const auto node : normalisationSites_)
for (const auto &node : normalisationSites_)
if (targetPopulation_ == SelectProcedureNode::SelectionPopulation::Average)
(*targetData1D_) /= (node->nAverageSites() / cfg->box()->volume());
else if (targetPopulation_ == SelectProcedureNode::SelectionPopulation::Available)
Expand All @@ -44,7 +44,7 @@ bool OperateNumberDensityNormaliseProcedureNode::operateData1D(const ProcessPool
// Operate on Data2D target
bool OperateNumberDensityNormaliseProcedureNode::operateData2D(const ProcessPool &procPool, Configuration *cfg)
{
for (const auto node : normalisationSites_)
for (const auto &node : normalisationSites_)
if (targetPopulation_ == SelectProcedureNode::SelectionPopulation::Average)
(*targetData2D_) /= (node->nAverageSites() / cfg->box()->volume());
else if (targetPopulation_ == SelectProcedureNode::SelectionPopulation::Available)
Expand All @@ -56,7 +56,7 @@ bool OperateNumberDensityNormaliseProcedureNode::operateData2D(const ProcessPool
// Operate on Data3D target
bool OperateNumberDensityNormaliseProcedureNode::operateData3D(const ProcessPool &procPool, Configuration *cfg)
{
for (const auto node : normalisationSites_)
for (const auto &node : normalisationSites_)
if (targetPopulation_ == SelectProcedureNode::SelectionPopulation::Average)
(*targetData3D_) /= (node->nAverageSites() / cfg->box()->volume());
else if (targetPopulation_ == SelectProcedureNode::SelectionPopulation::Available)
Expand Down