MemoryWriter: Remove unnecessary type cast within MemoryWriter constructor and setData()

The input type is already the same type as the class member, so the cast
is unnecessary.

While we're at it, we can also remove an unnecessary initializer for
m_position, since we initialize this to zero within the class
declaration already.
This commit is contained in:
Lioncash 2019-09-06 03:25:40 -04:00
parent 4e414902be
commit 57ad780321
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@
namespace athena::io {
MemoryWriter::MemoryWriter(atUint8* data, atUint64 length, bool takeOwnership)
: m_data((atUint8*)data), m_length(length), m_position(0), m_bufferOwned(takeOwnership) {
: m_data(data), m_length(length), m_bufferOwned(takeOwnership) {
if (!data) {
atError(fmt("data cannot be NULL"));
setError();
@ -156,7 +156,7 @@ void MemoryWriter::setData(atUint8* data, atUint64 length, bool takeOwnership) {
if (m_bufferOwned)
delete m_data;
m_data = (atUint8*)data;
m_data = data;
m_length = length;
m_position = 0;
m_bufferOwned = takeOwnership;