Skip to content

Commit

Permalink
fix(Buffer): add missing header and cleanup redundant stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mcakircali committed Sep 5, 2024
1 parent 6abe199 commit 4237a08
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/eckit/io/Buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* does it submit to any jurisdiction.
*/

#include <algorithm>
#include <cstring>

#include "eckit/exception/Exceptions.h"
Expand All @@ -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);
}
Expand Down

0 comments on commit 4237a08

Please sign in to comment.