mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 04:08:55 +02:00
Updating buffer parser to use new heapless API
This commit is contained in:
parent
49a14e3446
commit
f2beb79d23
1 changed files with 2 additions and 4 deletions
|
@ -53,11 +53,9 @@ public:
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline void readCompressedCount(T& result) {
|
inline void readCompressedCount(T& result) {
|
||||||
// FIXME switch to a heapless implementation as soon as Brad provides it.
|
// FIXME switch to a heapless implementation as soon as Brad provides it.
|
||||||
QByteArray encoded((const char*)(_data + _offset), std::min(sizeof(T) << 1, remaining()));
|
ByteCountCoded<T> codec;
|
||||||
ByteCountCoded<T> codec = encoded;
|
_offset += codec.decode(reinterpret_cast<const char*>(_data + _offset), remaining());
|
||||||
result = codec.data;
|
result = codec.data;
|
||||||
encoded = codec;
|
|
||||||
_offset += encoded.size();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline size_t remaining() const {
|
inline size_t remaining() const {
|
||||||
|
|
Loading…
Reference in a new issue