From 376fe5b4ae1607f4158e16bc4ace6e5b5b01154e Mon Sep 17 00:00:00 2001 From: weidai Date: Thu, 19 Jun 2003 17:09:07 +0000 Subject: sync with private branch --- queue.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'queue.cpp') diff --git a/queue.cpp b/queue.cpp index 976bb0c5..16de7720 100644 --- a/queue.cpp +++ b/queue.cpp @@ -234,9 +234,15 @@ void ByteQueue::LazyPut(const byte *inString, unsigned int size) { if (m_lazyLength > 0) FinalizeLazyPut(); - m_lazyString = const_cast(inString); - m_lazyLength = size; - m_lazyStringModifiable = false; + + if (inString == m_tail->buf+m_tail->m_tail) + Put(inString, size); + else + { + m_lazyString = const_cast(inString); + m_lazyLength = size; + m_lazyStringModifiable = false; + } } void ByteQueue::LazyPutModifiable(byte *inString, unsigned int size) -- cgit v1.2.1