@@ -138,7 +138,7 @@ std::string ParseDeviceType(std::shared_ptr<OVCore> ov_core, const ProviderOptio
138138 if (std::find (std::begin (available_devices), std::end (available_devices), device) != std::end (available_devices))
139139 device_found = true ;
140140 if (device_prefix != " CPU" && luid_list.size () > 0 ) {
141- for (auto dev : available_devices) {
141+ for (const auto & dev : available_devices) {
142142 ov::device::LUID ov_luid = OVCore::Get ()->core .get_property (dev, ov::device::luid);
143143 std::stringstream ov_luid_str;
144144 ov_luid_str << ov_luid;
@@ -153,7 +153,7 @@ std::string ParseDeviceType(std::shared_ptr<OVCore> ov_core, const ProviderOptio
153153 }
154154 if (luid_list.size () > 0 ) {
155155 std::string ov_luid_devices;
156- for (auto luid_str : luid_list) {
156+ for (const auto & luid_str : luid_list) {
157157 if (ov_luid_map.contains (luid_str)) {
158158 std::string ov_dev = ov_luid_map.at (luid_str);
159159 std::string ov_dev_strip = split (ov_dev, ' .' )[0 ];
@@ -170,14 +170,14 @@ std::string ParseDeviceType(std::shared_ptr<OVCore> ov_core, const ProviderOptio
170170 }
171171 if (!device_mode.empty ()) {
172172 selected_device = device_mode + " :" + ov_luid_devices;
173- for (auto dev_str : devices_to_check) {
174- auto default_dev = split (dev_str, ' .' )[0 ];
173+ for (const auto & dev_str : devices_to_check) {
174+ const auto & default_dev = split (dev_str, ' .' )[0 ];
175175
176176 if (ov_luid_devices.find (default_dev) == std::string::npos)
177177 selected_device = selected_device + " ," + dev_str;
178178 }
179179 } else {
180- selected_device = ov_luid_devices;
180+ selected_device = std::move ( ov_luid_devices) ;
181181 }
182182 }
183183 // If invalid device is chosen error is thrown
@@ -215,7 +215,7 @@ static void ParseProviderInfo(const ProviderOptions& provider_options,
215215 // Minor optimization: we'll hold an OVCore reference to ensure we don't create a new core between ParseDeviceType and
216216 // (potential) SharedContext creation.
217217 auto ov_core = OVCore::Get ();
218- pi.device_type = ParseDeviceType (ov_core, provider_options);
218+ pi.device_type = ParseDeviceType (std::move ( ov_core) , provider_options);
219219
220220 if (provider_options.contains (" device_id" )) {
221221 std::string dev_id = provider_options.at (" device_id" ).data ();
@@ -355,7 +355,7 @@ static void ParseProviderInfo(const ProviderOptions& provider_options,
355355
356356struct OpenVINOProviderFactory : IExecutionProviderFactory {
357357 OpenVINOProviderFactory (ProviderInfo provider_info, std::shared_ptr<SharedContext> shared_context)
358- : provider_info_(std::move(provider_info)), shared_context_(shared_context) {}
358+ : provider_info_(std::move(provider_info)), shared_context_(std::move( shared_context) ) {}
359359
360360 ~OpenVINOProviderFactory () override {}
361361
0 commit comments