Skip to content

Commit bbef373

Browse files
Apply suggestions from code review
Co-authored-by: Leonid Startsev <sandwwraith@users.noreply.github.com>
1 parent 2a5818b commit bbef373

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

formats/protobuf/commonMain/src/kotlinx/serialization/protobuf/internal/Helpers.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ internal fun extractProtoId(descriptor: SerialDescriptor, index: Int, zeroBasedD
111111

112112
private fun checkFieldNumber(fieldNumber: Int, descriptor: SerialDescriptor) {
113113
if (fieldNumber <= 0) {
114-
throw SerializationException("$fieldNumber is not allowed in ProtoNumber for ${descriptor.serialName}, because protobuf support field values in range 1..2147483647")
114+
throw SerializationException("$fieldNumber is not allowed in ProtoNumber for ${descriptor.serialName}, because protobuf support field numbers in range 1..${Int.MAX_VALUE}}")
115115
}
116116
}
117117

formats/protobuf/commonMain/src/kotlinx/serialization/protobuf/internal/ProtobufDecoding.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ internal open class ProtobufDecoder(
4848
*
4949
* Since the library allows the use of fields with proto ID 0,
5050
* it is necessary to initialize all elements, because there will always be one extra element
51-
* in the fast path array, which misses in the descriptor
51+
* in the fast path array, which is missing from the descriptor
5252
*/
5353
val cache = IntArray(elements + 1) { -1 }
5454
for (i in 0 until elements) {

0 commit comments

Comments
 (0)