Skip to content

Commit

Permalink
refs #132 Упрощение кода
Browse files Browse the repository at this point in the history
  • Loading branch information
izvolov committed Apr 17, 2021
1 parent 4ac3fbd commit 49d131e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions benchmark/include/utility/io/generate.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef BURST_BENCHMARK_UTILITY_IO_GENERATE_HPP
#define BURST_BENCHMARK_UTILITY_IO_GENERATE_HPP

#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <random>
Expand All @@ -21,12 +22,9 @@ namespace utility
std::uniform_int_distribution<std::int64_t> uniform(min, max);

*result++ = range_length;
for (auto i = 0ul; i < range_length; ++i)
{
*result++ = uniform(generator);
}

return result;
return
std::generate_n(result, range_length,
[& uniform, & generator] {return uniform(generator);});
}
} // namespace utility

Expand Down

0 comments on commit 49d131e

Please sign in to comment.