From 4237a087a8c81e50246be3d51624e884d8668f10 Mon Sep 17 00:00:00 2001 From: Metin Cakircali Date: Wed, 4 Sep 2024 18:03:39 +0200 Subject: [PATCH] fix(Buffer): add missing header and cleanup redundant stuff --- src/eckit/io/Buffer.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/eckit/io/Buffer.cc b/src/eckit/io/Buffer.cc index 635823bab..ca6e2452a 100644 --- a/src/eckit/io/Buffer.cc +++ b/src/eckit/io/Buffer.cc @@ -8,6 +8,7 @@ * does it submit to any jurisdiction. */ +#include #include #include "eckit/exception/Exceptions.h" @@ -32,19 +33,16 @@ static void deallocate(char*& buffer) { //---------------------------------------------------------------------------------------------------------------------- -Buffer::Buffer(const size_t size) : - buffer_{nullptr}, size_{size} { +Buffer::Buffer(const size_t size): size_ {size} { create(); } -Buffer::Buffer(const void* p, size_t len) : - buffer_{nullptr}, size_{len} { +Buffer::Buffer(const void* p, size_t len): size_ {len} { create(); copy(p, len); } -Buffer::Buffer(const std::string& s) : - buffer_{nullptr}, size_{s.length() + 1} { +Buffer::Buffer(const std::string& s): size_ {s.length() + 1} { create(); copy(s); }