@@ -57,12 +57,12 @@ internal open class StreamingJsonDecoder(
57
57
* dSVP reads the very next JSON tree into a memory as JsonElement and then runs TreeJsonDecoder over it
58
58
* in order to deal with an arbitrary order of keys, but with the price of additional memory pressure
59
59
* and CPU consumption.
60
- * We would like to provide best possible performance for data produced by kotlinx.serialization
60
+ * We would like to provide the best possible performance for data produced by kotlinx.serialization
61
61
* itself, for that we do the following optimistic optimization:
62
62
*
63
63
* 0) Remember current position in the string
64
64
* 1) Read the very next key of JSON structure
65
- * 2) If it matches* the descriminator key, read the value, remember current position
65
+ * 2) If it matches* the discriminator key, read the value, remember current position
66
66
* 3) Return the value, recover an initial position
67
67
* (*) -- if it doesn't match, fallback to dSVP method.
68
68
*/
@@ -114,7 +114,7 @@ internal open class StreamingJsonDecoder(
114
114
}
115
115
116
116
override fun endStructure (descriptor : SerialDescriptor ) {
117
- // If we're ignoring unknown keys, we have to skip all undecoded elements,
117
+ // If we're ignoring unknown keys, we have to skip all un-decoded elements,
118
118
// e.g. for object serialization. It can be the case when the descriptor does
119
119
// not have any elements and decodeElementIndex is not invoked at all
120
120
if (json.configuration.ignoreUnknownKeys && descriptor.elementsCount == 0 ) {
@@ -246,8 +246,8 @@ internal open class StreamingJsonDecoder(
246
246
if (configuration.ignoreUnknownKeys || discriminatorHolder.trySkip(key)) {
247
247
lexer.skipElement(configuration.isLenient)
248
248
} else {
249
- // Here we cannot properly update json path indicies
250
- // as we do not have a proper SerialDecriptor in our hands
249
+ // Here we cannot properly update json path indices
250
+ // as we do not have a proper SerialDescriptor in our hands
251
251
lexer.failOnUnknownKey(key)
252
252
}
253
253
return lexer.tryConsumeComma()
@@ -268,8 +268,8 @@ internal open class StreamingJsonDecoder(
268
268
269
269
override fun decodeBoolean (): Boolean {
270
270
/*
271
- * We prohibit non true/false boolean literals at all as it is considered way too error-prone,
272
- * but allow quoted literal in relaxed mode for booleans.
271
+ * We prohibit any boolean literal that is not strictly 'true' or 'false' as it is considered way too
272
+ * error-prone, but allow quoted literal in relaxed mode for booleans.
273
273
*/
274
274
return if (configuration.isLenient) {
275
275
lexer.consumeBooleanLenient()
0 commit comments