Skip to content

Commit

Permalink
Fix auto_causes_copy coverity issue
Browse files Browse the repository at this point in the history
CIDs: 1537935, 1537274, 1537934,
1537922, 1537637
  • Loading branch information
vurusovs committed Apr 24, 2024
1 parent 7145122 commit c05cb89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/reference/src/op/if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void if_reference(const std::vector<std::shared_ptr<Model>>& bodies,
OPENVINO_ASSERT(output_size > out_descr->m_output_index,
"Incorrect associating! If has not output with id ",
out_descr->m_output_index);
auto res = outs_from_body[out_descr->m_body_value_index];
const auto& res = outs_from_body[out_descr->m_body_value_index];
res.copy_to(out[out_descr->m_output_index]);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/core/src/pass/serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,8 @@ class XmlSerializer : public ov::AttributeVisitor {
}
}
if (is_body_target) {
auto body_name = std::get<0>(bnames);
auto portmap_name = std::get<1>(bnames);
const auto& body_name = std::get<0>(bnames);
const auto& portmap_name = std::get<1>(bnames);
std::vector<std::string> result_mapping =
map_type_from_body(m_xml_node.parent(), "Result", m_version, body_name);
std::vector<std::string> parameter_mapping =
Expand Down Expand Up @@ -1004,12 +1004,12 @@ void ngfunction_2_ir(pugi::xml_node& netXml,
pugi::xml_node port = input.append_child("port");
port.append_attribute("id").set_value(port_id++);

auto rt_info = i.get_tensor().get_rt_info();
const auto& rt_info = i.get_tensor().get_rt_info();
auto port_element_type =
is_fp16_compression_postponed(rt_info) ? ov::element::f16 : i.get_element_type();

port.append_attribute("precision").set_value(get_precision_name(port_element_type).c_str());
for (auto d : i.get_partial_shape()) {
for (const auto& d : i.get_partial_shape()) {
pugi::xml_node dim = port.append_child("dim");
if (d.is_dynamic()) {
dim.append_child(pugi::xml_node_type::node_pcdata).set_value("-1");
Expand Down

0 comments on commit c05cb89

Please sign in to comment.