Skip to content

Commit 56b5b4d

Browse files
Add some optimization for unconditionalModifications promotion
1 parent aaf58ec commit 56b5b4d

File tree

1 file changed

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

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ internal fun <T> List<ParserStructure<T>>.concat(): ParserStructure<T> {
123123
other.followedBy
124124
}
125125

126-
return if (mergedTails.none { it.operations.firstOrNull() is NumberSpanParserOperation }) {
126+
return if (
127+
currentNumberSpan == null && newOperations.isNotEmpty() ||
128+
mergedTails.none { it.operations.firstOrNull() is NumberSpanParserOperation }
129+
) {
127130
if (currentNumberSpan != null) {
128131
newOperations.add(NumberSpanParserOperation(currentNumberSpan))
129132
}

0 commit comments

Comments
 (0)