Skip to content

Commit

Permalink
changing preprocessor if statement to if condition inside constructor…
Browse files Browse the repository at this point in the history
… block
  • Loading branch information
zachar1a committed Aug 2, 2021
1 parent 0cf94cd commit 69c6dda
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Fw/Buffer/Buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,15 @@ Buffer::Buffer(const Buffer& src) : Serializable(),
{}

Buffer::Buffer(U8* data, U32 size, U32 context) : Serializable(),
#if data == nullptr && size == 0
m_serialize_repr(),
m_bufferData(NULL),
m_size(0),
m_context(0xFFFFFFFF)
{}
#else
m_serialize_repr(data, size),
m_bufferData(data),
m_size(size),
m_context(context)
{}
#endif
{
if(m_bufferData != NULL){
this->m_serialize_repr.setExtBuffer(m_bufferData, m_size);
}
}

Buffer& Buffer::operator=(const Buffer& src) {
// Ward against self-assignment
Expand Down

0 comments on commit 69c6dda

Please sign in to comment.