refactor: StreamBuffer::write use emplace when adding m_chunks

This commit is contained in:
sithlord48 2025-09-04 22:16:35 -04:00 committed by Nick Bolton
parent 6cfd89af8c
commit 27075a0260

View file

@ -91,7 +91,7 @@ void StreamBuffer::write(const void *vdata, uint32_t n)
} }
} }
if (scan == m_chunks.end()) { if (scan == m_chunks.end()) {
scan = m_chunks.insert(scan, Chunk()); scan = m_chunks.emplace(scan, Chunk());
} }
// append data in chunks // append data in chunks
@ -110,7 +110,7 @@ void StreamBuffer::write(const void *vdata, uint32_t n)
// append another empty chunk if we're not done yet // append another empty chunk if we're not done yet
if (n > 0) { if (n > 0) {
++scan; ++scan;
scan = m_chunks.insert(scan, Chunk()); scan = m_chunks.emplace(scan, Chunk());
} }
} }
} }