Minor MemoryWriter and VectorWriter behavior changes

This commit is contained in:
Jack Andersen 2018-09-02 14:45:02 -10:00
parent b57390e304
commit 488acc8675
2 changed files with 2 additions and 26 deletions

View File

@ -30,14 +30,6 @@ MemoryReader::MemoryReader(const void* data, atUint64 length, bool takeOwnership
setError();
return;
}
if (length == 0)
{
if (m_globalErr)
atError("length cannot be 0");
setError();
return;
}
}
MemoryReader::~MemoryReader()
@ -57,14 +49,6 @@ MemoryCopyReader::MemoryCopyReader(const void* data, atUint64 length)
return;
}
if (length == 0)
{
if (m_globalErr)
atError("length cannot be 0");
setError();
return;
}
m_dataCopy.reset(new atUint8[m_length]);
m_data = m_dataCopy.get();
memmove(m_dataCopy.get(), data, m_length);

View File

@ -22,11 +22,7 @@ void VectorWriter::seek(atInt64 position, SeekOrigin origin)
}
if ((atUint64)position > m_data.size())
{
atError("data exceeds vector size");
setError();
return;
}
m_data.resize(position);
m_position = position;
break;
@ -40,11 +36,7 @@ void VectorWriter::seek(atInt64 position, SeekOrigin origin)
}
if (m_position + position > m_data.size())
{
atError("data exceeds vector size");
setError();
return;
}
m_data.resize(m_position + position);
m_position += position;
break;