mirror of https://github.com/libAthena/athena.git
Minor MemoryWriter and VectorWriter behavior changes
This commit is contained in:
parent
b57390e304
commit
488acc8675
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue