summaryrefslogtreecommitdiff
path: root/queue.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-05-16 00:02:31 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-05-16 00:02:31 +0000
commit36fa3fc2b13356f20ed58c37cdeb68c830c59829 (patch)
treebf937217f2ef50484de29e14afe933833ee627b6 /queue.cpp
parentb2f2c1f2c534d20cd06aed7717b19b8ab101e254 (diff)
downloadcryptopp-36fa3fc2b13356f20ed58c37cdeb68c830c59829.tar.gz
misc optimizations
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@68 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'queue.cpp')
-rw-r--r--queue.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/queue.cpp b/queue.cpp
index 8ef1141..b5ac16d 100644
--- a/queue.cpp
+++ b/queue.cpp
@@ -344,8 +344,9 @@ void ByteQueue::Unget(byte inByte)
void ByteQueue::Unget(const byte *inString, unsigned int length)
{
unsigned int len = STDMIN(length, m_head->m_head);
- memcpy(m_head->buf + m_head->m_head - len, inString + length - len, len);
length -= len;
+ m_head->m_head -= len;
+ memcpy(m_head->buf + m_head->m_head, inString + length, len);
if (length > 0)
{