Skip to content

Commit abdf1d4

Browse files
Refactor Parser to replace drop(1) with an explicit loop for merging operations.
1 parent 0f5f901 commit abdf1d4

File tree

1 file changed

+3
-1
lines changed
  • core/common/src/internal/format/parser

1 file changed

+3
-1
lines changed

core/common/src/internal/format/parser/Parser.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ internal fun <T> List<ParserStructure<T>>.concat(): ParserStructure<T> {
5858
}
5959
firstOperation is NumberSpanParserOperation -> {
6060
add(NumberSpanParserOperation(numberSpan + firstOperation.consumers))
61-
addAll(operationsToMerge.drop(1))
61+
for (i in 1..operationsToMerge.lastIndex) {
62+
add(operationsToMerge[i])
63+
}
6264
}
6365
else -> {
6466
add(NumberSpanParserOperation(numberSpan))

0 commit comments

Comments
 (0)