aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Packets/ByteBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/shared/Packets/ByteBuffer.cpp')
-rw-r--r--src/server/shared/Packets/ByteBuffer.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp
index cdb73987453..f495982ac14 100644
--- a/src/server/shared/Packets/ByteBuffer.cpp
+++ b/src/server/shared/Packets/ByteBuffer.cpp
@@ -48,7 +48,7 @@ template <typename T> void BitStream::WriteBits(T value, size_t bits)
for (int32 i = bits-1; i >= 0; --i)
WriteBit((value >> i) & 1);
}
-
+
bool BitStream::Emtpy ()
{
return _data.empty();
@@ -68,22 +68,22 @@ void BitStream::Print()
{
if (!sLog->IsOutDebug())
return;
- std::stringstream ss;
- ss << "BitStream: ";
+ std::stringstream ss;
+ ss << "BitStream: ";
for (uint32 i = 0; i < GetLenght(); ++i)
- ss << uint32(GetBit(i)) << " ";
+ ss << uint32(GetBit(i)) << " ";
- sLog->outDebug(LOG_FILTER_NETWORKIO, ss.str().c_str());
+ sLog->outDebug(LOG_FILTER_NETWORKIO, ss.str().c_str());
}
ByteBuffer::ByteBuffer(size_t res, bool init): _rpos(0), _wpos(0), _bitpos(8), _curbitval(0)
{
if (init)
{
+ _storage.resize(res);
for (size_t i = 0; i < res; ++i)
- {
*this << uint8(0);
- }
- } else
+ }
+ else
_storage.reserve(res);
-} \ No newline at end of file
+}