From 5524d58835bcb38131a2d18e790984daf3196a22 Mon Sep 17 00:00:00 2001 From: Hyeongseok Oh Date: Wed, 28 Aug 2024 15:27:33 +0900 Subject: [PATCH] [onert] Use getUses() reference This commit updates to use getUses() return's reference explicitly. ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh --- .../src/compiler/train/pass/TrainableConstantInsertionPass.cc | 2 +- runtime/onert/core/src/ir/train/UseDefGenerator.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/onert/core/src/compiler/train/pass/TrainableConstantInsertionPass.cc b/runtime/onert/core/src/compiler/train/pass/TrainableConstantInsertionPass.cc index d4207031e05..67a50fb328d 100644 --- a/runtime/onert/core/src/compiler/train/pass/TrainableConstantInsertionPass.cc +++ b/runtime/onert/core/src/compiler/train/pass/TrainableConstantInsertionPass.cc @@ -40,7 +40,7 @@ void TrainableConstantInsertionPass::callback(const ir::OperationIndex &node_ind continue; // Insert new operands for shared constant except for the current node. - const auto uses = object.getUses(); + const auto &uses = object.getUses(); for (const auto &use_index : uses) { if (use_index == node_index) diff --git a/runtime/onert/core/src/ir/train/UseDefGenerator.cc b/runtime/onert/core/src/ir/train/UseDefGenerator.cc index af6f75003ff..a47bc912b48 100644 --- a/runtime/onert/core/src/ir/train/UseDefGenerator.cc +++ b/runtime/onert/core/src/ir/train/UseDefGenerator.cc @@ -425,7 +425,7 @@ void UseDefGenerator::initForForwardingNodes() } assert(_training_usedefs.at(forwarding_operand_index).getTrainingUses().size() == 0); - const auto uses = operand.getUses(); + const auto &uses = operand.getUses(); for (const auto &use : uses) insertUse(forwarding_operand_index, TrainingOperationIndex{use, is_forward}); });