Skip to content

Commit

Permalink
Use make_unique
Browse files Browse the repository at this point in the history
  • Loading branch information
EricaCMitchell committed Sep 13, 2024
1 parent 30ce5ea commit 92aea42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/madness/world/worldgop.h
Original file line number Diff line number Diff line change
Expand Up @@ -785,11 +785,11 @@ namespace madness {
world_.mpi.binary_tree_info(0, parent, child0, child1);
const std::size_t nelem_per_maxmsg = max_reducebcast_msg_size() / sizeof(T);

std::unique_ptr<T[]> buf0 = (child0 != -1)
? std::unique_ptr<T[]>(new T[std::min(nelem_per_maxmsg,nelem)])
auto buf0 = (child0 != -1)
? std::make_unique<T[]>(std::min(nelem_per_maxmsg, nelem))
: nullptr;
std::unique_ptr<T[]> buf1 = (child1 != -1)
? std::unique_ptr<T[]>(new T[std::min(nelem_per_maxmsg,nelem)])
auto buf1 = (child1 != -1)
? std::make_unique<T[]>(std::min(nelem_per_maxmsg, nelem))
: nullptr;

auto reduce_impl = [&,this](T* buf, int nelem) {
Expand Down

0 comments on commit 92aea42

Please sign in to comment.