diff --git a/src/inference/src/dev/core_impl.cpp b/src/inference/src/dev/core_impl.cpp index b51c4d916eb..458563633ed 100644 --- a/src/inference/src/dev/core_impl.cpp +++ b/src/inference/src/dev/core_impl.cpp @@ -366,7 +366,7 @@ void ov::CoreImpl::register_plugin_in_registry_unsafe(const std::string& device_ auto fallback = it->second.as(); // Change fallback name if fallback is configured to the HW plugin under the proxy with the same name if (defaultConfig.find(ov::device::priorities.name()) == defaultConfig.end()) { - defaultConfig[ov::device::priorities.name()] = std::vector{dev_name, fallback}; + defaultConfig[ov::device::priorities.name()] = std::vector{dev_name, std::move(fallback)}; } else { auto dev_order = defaultConfig[ov::device::priorities.name()].as>(); auto begin_it = std::find(dev_order.begin(), dev_order.end(), dev_name); diff --git a/src/plugins/hetero/src/compiled_model.cpp b/src/plugins/hetero/src/compiled_model.cpp index 9f5ee7c634a..cf4a52a6202 100644 --- a/src/plugins/hetero/src/compiled_model.cpp +++ b/src/plugins/hetero/src/compiled_model.cpp @@ -412,9 +412,6 @@ void ov::hetero::CompiledModel::export_model(std::ostream& model_stream) const { auto subnetworksNode = heteroNode.append_child("compiled_submodels"); for (const auto& comp_model_desc : m_compiled_submodels) { - auto sub_comp_model = comp_model_desc.compiled_model; - OPENVINO_ASSERT(sub_comp_model); - auto subnetworkNode = subnetworksNode.append_child("compiled_submodel"); subnetworkNode.append_attribute("device").set_value(comp_model_desc.device.c_str()); } @@ -431,6 +428,7 @@ void ov::hetero::CompiledModel::export_model(std::ostream& model_stream) const { model_stream << std::endl; for (const auto& comp_model_desc : m_compiled_submodels) { + OPENVINO_ASSERT(comp_model_desc.compiled_model); if (get_plugin()->get_core()->device_supports_model_caching(comp_model_desc.device)) { try { // Batch plugin reports property of low level plugin @@ -441,7 +439,7 @@ void ov::hetero::CompiledModel::export_model(std::ostream& model_stream) const { } catch (ov::NotImplemented&) { } } - auto model = comp_model_desc.model; + auto& model = comp_model_desc.model; if (!model) OPENVINO_THROW("OpenVINO Model is empty"); diff --git a/src/plugins/template/src/compiled_model.cpp b/src/plugins/template/src/compiled_model.cpp index 32276213057..02fa9ec36e4 100644 --- a/src/plugins/template/src/compiled_model.cpp +++ b/src/plugins/template/src/compiled_model.cpp @@ -139,7 +139,7 @@ ov::Any ov::template_plugin::CompiledModel::get_property(const std::string& name return rw_properties; }; if (ov::model_name == name) { - auto model_name = m_model->get_friendly_name(); + auto& model_name = m_model->get_friendly_name(); return decltype(ov::model_name)::value_type(model_name); } else if (ov::loaded_from_cache == name) { return m_loaded_from_cache;