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