From c181654f0914c09f077944eb7f4fa8defb31fd98 Mon Sep 17 00:00:00 2001 From: ItsBasi <5033630+ItsBasi@users.noreply.github.com> Date: Thu, 16 Sep 2021 13:59:06 +0200 Subject: [PATCH] Avoid using pointers to temporary copies of desired extensions. validExtensions now references data that remains constant for its entire life-time. Signed-off-by: ItsBasi <5033630+ItsBasi@users.noreply.github.com> --- src/Manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Manager.cpp b/src/Manager.cpp index d1cecd5a5..d87a712ab 100644 --- a/src/Manager.cpp +++ b/src/Manager.cpp @@ -384,7 +384,7 @@ Manager::createDevice(const std::vector& familyQueueIndices, KP_LOG_DEBUG("Kompute Manager available extensions {}", uniqueExtensionNames); std::vector validExtensions; - for (std::string ext : desiredExtensions) { + for (const std::string& ext : desiredExtensions) { if (uniqueExtensionNames.count(ext) != 0) { validExtensions.push_back(ext.c_str()); }