1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 12:33:17 +01:00

Initialise fields of MemoryStream in header

This makes all the constructors use these defaulted values
This commit is contained in:
Michał Janiszewski
2017-01-12 09:58:57 +01:00
committed by GitHub
parent afbe1dda0f
commit 171d973e55
2 changed files with 6 additions and 21 deletions

View File

@@ -18,17 +18,6 @@
#include "Memory.hpp"
#include "MemoryStream.h"
MemoryStream::MemoryStream()
{
_access = MEMORY_ACCESS_READ |
MEMORY_ACCESS_WRITE |
MEMORY_ACCESS_OWNER;
_dataCapacity = 0;
_dataSize = 0;
_data = nullptr;
_position = nullptr;
}
MemoryStream::MemoryStream(const MemoryStream &copy)
{
_access = copy._access;
@@ -44,11 +33,7 @@ MemoryStream::MemoryStream(const MemoryStream &copy)
MemoryStream::MemoryStream(size_t capacity)
{
_access = MEMORY_ACCESS_READ |
MEMORY_ACCESS_WRITE |
MEMORY_ACCESS_OWNER;
_dataCapacity = capacity;
_dataSize = 0;
_data = Memory::Allocate<void>(capacity);
_position = _data;
}