Skip to content

Commit

Permalink
[circle-mqpsolver] Prevent copy of an object (#12308)
Browse files Browse the repository at this point in the history
This commit prevents from copying of an object when using auto keyword.

ONE-DCO-1.0-Signed-off-by: seongwoo <[email protected]>
  • Loading branch information
mhs4670go authored Dec 15, 2023
1 parent 790152a commit e2df8b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void VISQErrorApproximator::init(std::istream &visq_data)

auto layers = completeJsonData["error"][0];
auto names = layers.getMemberNames();
for (auto name : names)
for (const auto &name : names)
{
auto value = layers[name].asFloat();
_layer_errors[name] = value;
Expand Down
4 changes: 2 additions & 2 deletions compiler/circle-mpqsolver/src/pattern/PatternSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void PatternSolver::setMPQOptions(MPQOptions &options) { _options = options; }
LayerParams PatternSolver::getFrozenParams() const
{
LayerParams params;
for (auto node_to_param : _frozen._node_to_param)
for (const auto &node_to_param : _frozen._node_to_param)
{
params.push_back(std::make_shared<LayerParam>(node_to_param.second));
}
Expand Down Expand Up @@ -95,7 +95,7 @@ void PatternSolver::resolvePatterns(luci::Module *module)
}

auto const resolved = resolver->resolve(module);
for (auto node_param : resolved)
for (const auto &node_param : resolved)
{
auto const frozen = _frozen._node_to_param.find(node_param.first);
if (frozen == _frozen._node_to_param.end())
Expand Down

0 comments on commit e2df8b3

Please sign in to comment.