diff --git a/src/libs/antares/file-tree-study-loader/FileTreeStudyLoader.cpp b/src/libs/antares/file-tree-study-loader/FileTreeStudyLoader.cpp index 5302c19263..8ff1c2730d 100644 --- a/src/libs/antares/file-tree-study-loader/FileTreeStudyLoader.cpp +++ b/src/libs/antares/file-tree-study-loader/FileTreeStudyLoader.cpp @@ -49,15 +49,10 @@ namespace * @param study_path A string_view representing the study path. * @return std::vector A vector of strings containing the prepared arguments. */ -[[nodiscard]] std::vector prepareArgs(std::span argv, - std::string_view study_path) +void prepareArgs(std::array& argv, std::span data) { - using namespace std::literals::string_literals; - std::string arg0{""s}; - std::string arg1{study_path}; - argv[0] = arg0.data(); - argv[1] = arg1.data(); - return {std::move(arg0), std::move(arg1)}; + argv[0] = data[0].data(); + argv[1] = data[1].data(); } } // namespace @@ -66,8 +61,9 @@ std::unique_ptr FileTreeStudyLoader::load() const using namespace std::literals::string_literals; Antares::Solver::Application application; constexpr unsigned int argc = 2; + std::array keep_alive{""s, study_path_.string()}; std::array argv; - auto keep_alive = prepareArgs(argv, study_path_.string()); + prepareArgs(argv, keep_alive); application.prepare(argc, argv.data()); return application.acquireStudy();