mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 08:43:02 +08:00
refactor(context): sort context blocks by descending
This commit is contained in:
@@ -77,11 +77,10 @@ class ContextWorkspace {
|
|||||||
|
|
||||||
val blocks = activeBlocks
|
val blocks = activeBlocks
|
||||||
.sortedWith(
|
.sortedWith(
|
||||||
compareBy<ResolvedContextBlock> { it.domainWeight }
|
compareByDescending<ResolvedContextBlock> { it.domainWeight }
|
||||||
|
.thenByDescending { it.activationScore }
|
||||||
.thenBy { it.block.sourceKey.blockName }
|
.thenBy { it.block.sourceKey.blockName }
|
||||||
.thenBy { it.block.sourceKey.source }
|
.thenBy { it.block.sourceKey.source }
|
||||||
.thenBy { it.activationScore }
|
|
||||||
.thenBy { it.block.blockContent.encodeToXmlString() }
|
|
||||||
)
|
)
|
||||||
.groupBy { it.block.sourceKey }
|
.groupBy { it.block.sourceKey }
|
||||||
.values
|
.values
|
||||||
|
|||||||
Reference in New Issue
Block a user