From 42384cbf7775131d4c86528f6731326a0e080882 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Sun, 8 Jan 2023 13:59:46 -0600 Subject: [PATCH] chore(datastore): clean up getter for data at offset --- common/datastore/CDataStore.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/common/datastore/CDataStore.cpp b/common/datastore/CDataStore.cpp index 5e07349..aff618b 100644 --- a/common/datastore/CDataStore.cpp +++ b/common/datastore/CDataStore.cpp @@ -75,12 +75,13 @@ void CDataStore::GetBufferParams(const void** data, uint32_t* size, uint32_t* al CDataStore& CDataStore::GetDataInSitu(void*& val, uint32_t bytes) { STORM_ASSERT(this->IsFinal()); - // TODO FetchRead + if (this->FetchRead(this->m_read, bytes)) { + auto ofs = this->m_read - this->m_base; + auto ptr = &this->m_data[ofs]; + val = ptr; - auto ofs = this->m_read - this->m_base; - val = &this->m_data[ofs]; - - this->m_read += bytes; + this->m_read += bytes; + } return *this; }