Use const stuff for PacketReader

This commit is contained in:
Joshua Ashton 2020-07-28 05:29:02 +01:00
parent 051a574aa7
commit b23dce8ac9
1 changed files with 4 additions and 3 deletions

View File

@ -11,6 +11,7 @@ namespace Feather::Network
{
public:
PacketReader(uint8_t* dataPtr)
: m_data(dataPtr), m_length(ReadVarInt())
{
m_data = dataPtr;
m_length = ReadVarInt();
@ -45,9 +46,9 @@ namespace Feather::Network
uint32_t Length() const { return m_length; }
private:
uint8_t* m_data;
uint32_t m_length;
uint32_t m_offset = 0;
const uint8_t const* m_data;
const uint32_t m_length;
uint32_t m_offset = 0;
};
}