From b29faa6a45acca84f436915d49a5d291bb21e936 Mon Sep 17 00:00:00 2001 From: Nil Geisweiller Date: Thu, 5 Aug 2021 14:46:56 +0300 Subject: [PATCH] Fix more stringent gcc 11 warnings --- opencog/ure/MixtureModel.cc | 2 +- opencog/ure/backwardchainer/ControlPolicy.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opencog/ure/MixtureModel.cc b/opencog/ure/MixtureModel.cc index a008a17c67..ed821315e9 100644 --- a/opencog/ure/MixtureModel.cc +++ b/opencog/ure/MixtureModel.cc @@ -49,7 +49,7 @@ TruthValuePtr MixtureModel::operator()() const std::vector tvs; std::vector weights; - for (const Handle model : models) { + for (const Handle& model : models) { double weight = prior_estimate(model) * beta_factor(model); LAZY_URE_LOG_FINE << "MixtureModel::operator model = " << model->id_to_string() << ", weight = " << weight; diff --git a/opencog/ure/backwardchainer/ControlPolicy.cc b/opencog/ure/backwardchainer/ControlPolicy.cc index ef4f348854..08206397e6 100644 --- a/opencog/ure/backwardchainer/ControlPolicy.cc +++ b/opencog/ure/backwardchainer/ControlPolicy.cc @@ -446,7 +446,7 @@ Handle ControlPolicy::mk_expansion_control_rules_query(const Handle& inf_rule, // ImplicationScope with a pattern in its antecedent to // retrieve HandleSeq antecedents{in_preproof_eval, expand_exec}; - for (const Handle pv : pattern_vars) + for (const Handle& pv : pattern_vars) antecedents.push_back(al(UNQUOTE_LINK, pv)); Handle pat_expand_preproof_impl = al(QUOTE_LINK, al(IMPLICATION_SCOPE_LINK,