diff --git a/support/src/utils/file.cpp b/support/src/utils/file.cpp index a60ec9e7..21349cc4 100644 --- a/support/src/utils/file.cpp +++ b/support/src/utils/file.cpp @@ -87,12 +87,10 @@ auto create_temp_name(std::string_view file_part) -> std::string { utils::generate_random_between(0U, 9U), }; - auto name = std::string{file_part} + '_'; - for (auto &&val : data) { - name += std::to_string(val); - } - - return name; + return std::accumulate(data.begin(), data.end(), std::string{file_part} + '_', + [](auto &&name, auto &&val) -> auto { + return name + std::to_string(val); + }); } auto create_temp_name(std::wstring_view file_part) -> std::wstring {