mirror of
https://github.com/mangosfour/server.git
synced 2025-12-27 10:37:02 +00:00
[7929] Some fixes and optimizations for work with packet guids.
* Allocate only minimal required buffer size for object packet guid cache, avoid it realocation. * At adding aboyher buffer content copy only until wpos (really writed to buffer data) * In appendPackGUID check buffer size before data write.
This commit is contained in:
parent
0bfcc44bb8
commit
fb45529eff
4 changed files with 8 additions and 6 deletions
|
|
@ -309,11 +309,14 @@ class ByteBuffer
|
|||
}
|
||||
void append(const ByteBuffer& buffer)
|
||||
{
|
||||
if(buffer.size()) append(buffer.contents(),buffer.size());
|
||||
if(buffer.size()) append(buffer.contents(),buffer.wpos());
|
||||
}
|
||||
|
||||
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++)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7928"
|
||||
#define REVISION_NR "7929"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue