From: Daniel Arndt Date: Thu, 9 Mar 2023 22:52:29 +0000 (-0500) Subject: Try making clang-tidy happy X-Git-Tag: v9.5.0-rc1~495^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=817395fd26f6282bdc2b43c5436337e3c04a071d;p=dealii.git Try making clang-tidy happy --- diff --git a/source/base/mpi.cc b/source/base/mpi.cc index 0e0454697c..f4642bc077 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -777,18 +777,18 @@ namespace Utilities // Initialize Kokkos { - std::vector argv_new; + std::vector argv_new(argc + 2); for (int i = 0; i < argc; ++i) - argv_new.push_back(argv[i]); + argv_new[i] = argv[i]; std::stringstream threads_flag; #if KOKKOS_VERSION >= 30700 threads_flag << "--kokkos-num-threads=" << MultithreadInfo::n_threads(); #else threads_flag << "--kokkos-threads=" << MultithreadInfo::n_threads(); #endif - argv_new.push_back(const_cast(threads_flag.str().c_str())); - argv_new.push_back(nullptr); - int argc_new = argc + 1; + argv_new[argc] = const_cast(threads_flag.str().c_str()); + argv_new[argc + 1] = nullptr; + int argc_new = argc + 1; Kokkos::initialize(argc_new, argv_new.data()); }