diff options
Diffstat (limited to 'src/shared/ByteBuffer.h')
-rw-r--r-- | src/shared/ByteBuffer.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/shared/ByteBuffer.h b/src/shared/ByteBuffer.h index d5001cfc1bf..6fd0c9b883d 100644 --- a/src/shared/ByteBuffer.h +++ b/src/shared/ByteBuffer.h @@ -386,21 +386,21 @@ class ByteBuffer void appendPackGUID(uint64 guid) { - if (_storage.size() < _wpos + sizeof(guid) + 1) - _storage.resize(_wpos + sizeof(guid) + 1); - - size_t mask_position = wpos(); - *this << uint8(0); - for (uint8 i = 0; i < 8; ++i) + uint8 packGUID[8+1]; + packGUID[0] = 0; + size_t size = 1; + for(uint8 i = 0;guid != 0;++i) { if(guid & 0xFF) { - _storage[mask_position] |= uint8(1 << i); - *this << uint8(guid & 0xFF); + packGUID[0] |= uint8(1 << i); + packGUID[size] = uint8(guid & 0xFF); + ++size; } guid >>= 8; } + append(packGUID, size); } void put(size_t pos, const uint8 *src, size_t cnt) |