From 69c6ddaf7a6306e16c293379dddb373d47cd9c4b Mon Sep 17 00:00:00 2001 From: Zachary Gonzalez Date: Mon, 2 Aug 2021 18:50:51 -0500 Subject: [PATCH] changing preprocessor if statement to if condition inside constructor block --- Fw/Buffer/Buffer.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Fw/Buffer/Buffer.cpp b/Fw/Buffer/Buffer.cpp index e517bb20693..f7c09f8036e 100644 --- a/Fw/Buffer/Buffer.cpp +++ b/Fw/Buffer/Buffer.cpp @@ -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