From 8af2350eabf890134f4b659430853cbe9acaf44d Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Thu, 14 Jul 2022 15:23:24 +0800 Subject: [PATCH] KeyHandler // Use spanLength for stableSort(). --- Source/Modules/ControllerModules/KeyHandler_Core.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Modules/ControllerModules/KeyHandler_Core.swift b/Source/Modules/ControllerModules/KeyHandler_Core.swift index 50af2fc9..93217d84 100644 --- a/Source/Modules/ControllerModules/KeyHandler_Core.swift +++ b/Source/Modules/ControllerModules/KeyHandler_Core.swift @@ -229,7 +229,7 @@ class KeyHandler { if arrAnchors.isEmpty { return .init() } // 讓更長的節錨排序靠前。 - arrAnchors = arrAnchors.stableSort { $0.keyLength > $1.keyLength } + arrAnchors = arrAnchors.stableSort { $0.spanLength > $1.spanLength } // 將節錨內的候選字詞資料拓印到輸出陣列內。 for currentCandidate in arrAnchors.map(\.node.candidates).joined() {