Skip to content

Commit

Permalink
use writeInt16/readInt16 for more compact representation.
Browse files Browse the repository at this point in the history
  • Loading branch information
wywen committed Oct 16, 2024
1 parent eafa066 commit ee9a5fa
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ class UShortSerializer(
true
) {
override fun write(buffer: MemoryBuffer, value: UShort) {
buffer.writeVarUint32(value.toInt())
buffer.writeInt16(value.toShort())
}
override fun read(buffer: MemoryBuffer): UShort {
return buffer.readVarUint32().toUShort()
return buffer.readInt16().toUShort()
}
}

Expand Down

0 comments on commit ee9a5fa

Please sign in to comment.