Skip to content

Commit

Permalink
Buffer utest: use make_unique
Browse files Browse the repository at this point in the history
  • Loading branch information
lamphamsy committed Sep 28, 2018
1 parent a62d609 commit e0a618e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/buffers_utest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class BuffersTest : public ::testing::Test {
T max_val = 65537;
const int max = (_max == 0) ? max_val : _max;
std::uniform_int_distribution<uint32_t> dis(0, max - 1);
auto vec =
std::unique_ptr<vec::Buffers<T>>(new vec::Buffers<T>(n, size));
auto vec = std::make_unique<vec::Buffers<T>>(n, size);

for (int i = 0; i < n; i++) {
T* buf = quadiron::aligned_allocate<T>(size);
Expand All @@ -71,7 +70,7 @@ class BuffersTest : public ::testing::Test {
}
std::random_shuffle(mem.begin(), mem.end());

auto vec = std::unique_ptr<vec::Vector<T>>(new vec::Vector<T>(gf, n));
auto vec = std::make_unique<vec::Vector<T>>(gf, n);
for (size_t i = 0; i < n; i++) {
vec->set(i, mem[i]);
}
Expand Down

0 comments on commit e0a618e

Please sign in to comment.