@@ -1179,14 +1179,11 @@ build_from_source(kernel_bundle<bundle_state::ext_oneapi_source> &SourceKB,
11791179 const std::vector<std::string> &BuildOptions,
11801180 std::string *LogPtr,
11811181 const std::vector<std::string> &RegisteredKernelNames) {
1182- std::vector<sycl::detail::string_view> Options;
1183- Options.reserve (BuildOptions.size ());
1184- for (const std::string &opt : BuildOptions)
1185- Options.push_back (sycl::detail::string_view{opt});
1182+ std::vector<sycl::detail::string_view> Options{BuildOptions.begin (),
1183+ BuildOptions.end ()};
11861184
1187- std::vector<sycl::detail::string_view> KernelNames;
1188- for (const std::string &name : RegisteredKernelNames)
1189- KernelNames.push_back (sycl::detail::string_view{name});
1185+ std::vector<sycl::detail::string_view> KernelNames{
1186+ RegisteredKernelNames.begin (), RegisteredKernelNames.end ()};
11901187
11911188 if (LogPtr) {
11921189 sycl::detail::string Log;
@@ -1211,15 +1208,11 @@ compile_from_source(kernel_bundle<bundle_state::ext_oneapi_source> &SourceKB,
12111208 const std::vector<std::string> &CompileOptions,
12121209 std::string *LogPtr,
12131210 const std::vector<std::string> &RegisteredKernelNames) {
1214- std::vector<sycl::detail::string_view> Options;
1215- Options.reserve (CompileOptions.size ());
1216- for (const std::string &opt : CompileOptions)
1217- Options.push_back (sycl::detail::string_view{opt});
1218-
1219- std::vector<sycl::detail::string_view> KernelNames;
1220- KernelNames.reserve (RegisteredKernelNames.size ());
1221- for (const std::string &name : RegisteredKernelNames)
1222- KernelNames.push_back (sycl::detail::string_view{name});
1211+ std::vector<sycl::detail::string_view> Options{CompileOptions.begin (),
1212+ CompileOptions.end ()};
1213+
1214+ std::vector<sycl::detail::string_view> KernelNames{
1215+ RegisteredKernelNames.begin (), RegisteredKernelNames.end ()};
12231216
12241217 sycl::detail::string Log;
12251218 auto result = compile_from_source (SourceKB, Devices, Options,
0 commit comments