diff --git a/src/torrent/data/file_list.cc b/src/torrent/data/file_list.cc index 96db1a674..905fca939 100644 --- a/src/torrent/data/file_list.cc +++ b/src/torrent/data/file_list.cc @@ -565,7 +565,7 @@ FileList::create_chunk(uint64_t offset, uint32_t length, int prot) { if (offset + length > m_torrentSize) throw internal_error("Tried to access chunk out of range in FileList", data()->hash()); - std::unique_ptr chunk(new Chunk); + auto chunk = std::make_unique(); auto itr = std::find_if(begin(), end(), [offset](File* file) { return file->is_valid_position(offset); }); diff --git a/src/torrent/torrent.cc b/src/torrent/torrent.cc index bdb1ed849..668d0c7b3 100644 --- a/src/torrent/torrent.cc +++ b/src/torrent/torrent.cc @@ -134,7 +134,7 @@ encoding_list() { Download download_add(Object* object) { - std::unique_ptr download(new DownloadWrapper); + auto download = std::make_unique(); DownloadConstructor ctor; ctor.set_download(download.get()); diff --git a/src/torrent/utils/thread_interrupt.cc b/src/torrent/utils/thread_interrupt.cc index b8cb73f6f..efd9ab010 100644 --- a/src/torrent/utils/thread_interrupt.cc +++ b/src/torrent/utils/thread_interrupt.cc @@ -51,8 +51,8 @@ thread_interrupt::create_pair() { pair_type result; - result.first = std::unique_ptr(new thread_interrupt(fd1)); - result.second = std::unique_ptr(new thread_interrupt(fd2)); + result.first = std::make_unique(fd1); + result.second = std::make_unique(fd2); result.first->m_other = result.second.get(); result.second->m_other = result.first.get();