diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-12-19 19:45:58 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2024-12-19 19:45:58 +0100 |
commit | 5a1fe849783d0a9b41ce77eca565f3cfc2dfb197 (patch) | |
tree | d26f3c4a3c2523b51cf3511868d0b7d5ee44be69 /src/server/shared/Packets/ByteBuffer.cpp | |
parent | 736836a3f5307c9cdf5f843893ff9d144efa69d1 (diff) |
Core/PacketIO: Read directly into output variable for numeric ByteBuffer::operator>> overloads
Diffstat (limited to 'src/server/shared/Packets/ByteBuffer.cpp')
-rw-r--r-- | src/server/shared/Packets/ByteBuffer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp index a575e52bc1e..994cd371968 100644 --- a/src/server/shared/Packets/ByteBuffer.cpp +++ b/src/server/shared/Packets/ByteBuffer.cpp @@ -41,7 +41,7 @@ ByteBufferInvalidValueException::ByteBufferInvalidValueException(char const* typ ByteBuffer& ByteBuffer::operator>>(float& value) { - value = read<float>(); + read(&value, 1); if (!std::isfinite(value)) throw ByteBufferInvalidValueException("float", "infinity"); return *this; @@ -49,7 +49,7 @@ ByteBuffer& ByteBuffer::operator>>(float& value) ByteBuffer& ByteBuffer::operator>>(double& value) { - value = read<double>(); + read(&value, 1); if (!std::isfinite(value)) throw ByteBufferInvalidValueException("double", "infinity"); return *this; |