Skip to content

Commit

Permalink
[Core] Fix coverity issues (#24838)
Browse files Browse the repository at this point in the history
### Details:
 - Used move instead of copy.

### Tickets:
 - CVS-121621
  • Loading branch information
t-jankowski authored Jun 5, 2024
1 parent 41d460f commit de4d00a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/core/src/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ void ov::Model::replace_parameter(size_t parameter_index, const shared_ptr<ov::o
}

void ov::Model::set_topological_sort(topological_sort_t sorter) {
m_topological_sorter = sorter;
m_topological_sorter = std::move(sorter);
// reset topological nodes order cache as new sorter can have different behaviour
m_shared_rt_info->set_use_topological_cache(false);
}
Expand Down
10 changes: 5 additions & 5 deletions src/core/src/pass/visualize_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ bool ov::pass::VisualizeTree::run_on_model(const std::shared_ptr<ov::Model>& f)

size_t fake_node_ctr = 0;

traverse_nodes(f, [&](std::shared_ptr<Node> node) {
traverse_nodes(f, [&](const std::shared_ptr<Node>& node) {
add_node_arguments(node, height_maps, fake_node_ctr);
});

Expand All @@ -281,8 +281,8 @@ bool ov::pass::VisualizeTree::run_on_model(const std::shared_ptr<ov::Model>& f)

ov::pass::VisualizeTree::VisualizeTree(const std::string& file_name, node_modifiers_t nm, bool dot_only)
: m_name{file_name},
m_node_modifiers{nm},
m_dot_only(dot_only) {}
m_node_modifiers{std::move(nm)},
m_dot_only{dot_only} {}

void ov::pass::VisualizeTree::add_node_arguments(std::shared_ptr<Node> node,
std::unordered_map<Node*, HeightMap>& height_maps,
Expand All @@ -297,7 +297,7 @@ void ov::pass::VisualizeTree::add_node_arguments(std::shared_ptr<Node> node,
std::string("color=\"") + (arg->description() == "Parameter" ? "blue" : "black") + std::string("\"");
std::vector<std::string> attributes{"shape=\"box\"",
"style=\"dashed\"",
color,
std::move(color),
std::string("label=\"") + get_node_name(arg) + std::string("\n") +
get_constant_value(arg) + std::string("\"")};

Expand Down Expand Up @@ -344,8 +344,8 @@ void ov::pass::VisualizeTree::add_node_arguments(std::shared_ptr<Node> node,
std::string ov::pass::VisualizeTree::add_attributes(std::shared_ptr<Node> node) {
std::string rc;
if (m_nodes_with_attributes.find(node) == m_nodes_with_attributes.end()) {
m_nodes_with_attributes.insert(node);
rc = get_attributes(node);
m_nodes_with_attributes.insert(std::move(node));
}
return rc;
}
Expand Down

0 comments on commit de4d00a

Please sign in to comment.