From 75f5fd56ec623269d01f35cfb63cec3ba4e2a480 Mon Sep 17 00:00:00 2001 From: valb3r Date: Wed, 1 Jan 2025 15:41:04 +0200 Subject: [PATCH] FBP-395. Fix sort function --- .../bpmn/intellij/plugin/bpmn/parser/core/BaseBpmnParser.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml-parser-core/src/main/kotlin/com/valb3r/bpmn/intellij/plugin/bpmn/parser/core/BaseBpmnParser.kt b/xml-parser-core/src/main/kotlin/com/valb3r/bpmn/intellij/plugin/bpmn/parser/core/BaseBpmnParser.kt index b78f7362..5dd1f454 100644 --- a/xml-parser-core/src/main/kotlin/com/valb3r/bpmn/intellij/plugin/bpmn/parser/core/BaseBpmnParser.kt +++ b/xml-parser-core/src/main/kotlin/com/valb3r/bpmn/intellij/plugin/bpmn/parser/core/BaseBpmnParser.kt @@ -717,7 +717,7 @@ abstract class BaseBpmnParser: BpmnParser { // Sorting data in CustomizedXmlWriter is expensive performance-wise val existingElems = target.elements().map { it.name }.toMutableList() existingElems.add(addedSimpleName) - existingElems.sortedWith(Comparator.comparingInt { elementOrder(target.name, it) ?: Int.MAX_VALUE }) + existingElems.sortWith(Comparator.comparingInt { elementOrder(target.name, it) ?: Int.MAX_VALUE }) val addToIndex = existingElems.indexOf(addedSimpleName) val newElem = addElem()