From 0ef8783ce33b314fc4fc070ce5c3cc081b4f4ef5 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 8 May 2025 00:48:35 +0800 Subject: [PATCH] :art: Improve doc tree Name Alphabet sorting https://github.com/siyuan-note/siyuan/issues/14773 --- kernel/util/sort.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/util/sort.go b/kernel/util/sort.go index 3e0dc6c8e..daeff3a88 100644 --- a/kernel/util/sort.go +++ b/kernel/util/sort.go @@ -87,13 +87,13 @@ func PinYinCompare4FileTree(str1, str2 string) bool { // 长度不相等的情况下,比较前面相等的部分 if len(a) < len(b) { - if 0 == bytes.Compare(a, b[:len(a)]) { // 前面相等的情况下,比较长度 - return len(a) > len(b[:len(a)]) + if 0 == bytes.Compare(a, b[:len(a)]) { // 前面相等的情况下短的在前 + return true } return bytes.Compare(a, b[:len(a)]) < 0 } if 0 == bytes.Compare(a[:len(b)], b) { - return len(a[:len(b)]) > len(b) + return false } return bytes.Compare(a[:len(b)], b) < 0 }