Skip to content

Commit 1c49e71

Browse files
committed
Fix BufDecoder decodeChar and decodeEnum methods to streamline and correct usage of ByteBuf.
1 parent 8a5b0e0 commit 1c49e71

File tree

1 file changed

+2
-2
lines changed
  • src/main/kotlin/dev/slne/surf/bytebufserializer/internal

1 file changed

+2
-2
lines changed

src/main/kotlin/dev/slne/surf/bytebufserializer/internal/BufDecoder.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class BufDecoder<B : ByteBuf>(
5151
}
5252

5353
override fun decodeChar(): Char = useCustomOr {
54-
buf.readChar().toChar()
54+
buf.readChar()
5555
}
5656

5757

@@ -64,7 +64,7 @@ class BufDecoder<B : ByteBuf>(
6464

6565
override fun decodeEnum(enumDescriptor: SerialDescriptor): Int {
6666
return if (configuration.enumsWithOrdinal) {
67-
buf.readByte().toInt()
67+
decodeInt()
6868
} else {
6969
val name = decodeString()
7070
enumDescriptor.getElementIndex(name)

0 commit comments

Comments
 (0)