remove std::move when returning freshly created unique_ptr

master
Andre Puschmann 5 years ago
parent c7ee887170
commit 42080e59f1

@ -233,13 +233,13 @@ inline void byte_buffer_deleter::operator()(byte_buffer_t* buf) const
inline unique_byte_buffer_t allocate_unique_buffer(byte_buffer_pool& pool, bool blocking = false) inline unique_byte_buffer_t allocate_unique_buffer(byte_buffer_pool& pool, bool blocking = false)
{ {
return std::move(unique_byte_buffer_t(pool.allocate(nullptr, blocking), byte_buffer_deleter(&pool))); return unique_byte_buffer_t(pool.allocate(nullptr, blocking), byte_buffer_deleter(&pool));
} }
inline unique_byte_buffer_t inline unique_byte_buffer_t
allocate_unique_buffer(byte_buffer_pool& pool, const char* debug_name, bool blocking = false) allocate_unique_buffer(byte_buffer_pool& pool, const char* debug_name, bool blocking = false)
{ {
return std::move(unique_byte_buffer_t(pool.allocate(debug_name, blocking), byte_buffer_deleter(&pool))); return unique_byte_buffer_t(pool.allocate(debug_name, blocking), byte_buffer_deleter(&pool));
} }
} // namespace srslte } // namespace srslte

@ -92,7 +92,7 @@ public:
}; };
typedef std::unique_ptr<log_str, log_str_deleter> unique_log_str_t; typedef std::unique_ptr<log_str, log_str_deleter> unique_log_str_t;
void log_char(const char* msg) { log(std::move(unique_log_str_t(new log_str(msg), log_str_deleter()))); } void log_char(const char* msg) { log(unique_log_str_t(new log_str(msg), log_str_deleter())); }
virtual void log(unique_log_str_t msg) = 0; virtual void log(unique_log_str_t msg) = 0;

Loading…
Cancel
Save