remove redundant null check
This commit is contained in:
parent
9839507ecd
commit
65d16142aa
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue