remove redundant null check

This commit is contained in:
arvidn 2017-09-17 22:23:41 +02:00 committed by Arvid Norberg
parent 9839507ecd
commit 65d16142aa
2 changed files with 0 additions and 3 deletions

View File

@ -786,7 +786,6 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
{
std::size_t const buf_size = aux::numeric_cast<std::size_t>(bufs_size(bufs));
char* buf = new char[buf_size];
if (!buf) return false;
tmp = { buf, buf_size };
bufs = span<iovec_t const>(tmp);
return true;
@ -804,7 +803,6 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
{
std::size_t const buf_size = aux::numeric_cast<std::size_t>(bufs_size(bufs));
char* buf = new char[buf_size];
if (!buf) return false;
gather_copy(bufs, buf);
tmp = { buf, buf_size };
bufs = span<iovec_t const>(tmp);

View File

@ -166,7 +166,6 @@ namespace libtorrent {
if (str == nullptr) return nullptr;
std::size_t const len = std::strlen(str);
char* tmp = new char[len + 1];
if (tmp == nullptr) return nullptr;
std::copy(str, str + len, tmp);
tmp[len] = '\0';
return tmp;