From 0ed68847618c241704702757c3324493a3fb8c2a Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Mon, 9 Oct 2023 21:09:35 +0800 Subject: [PATCH] :bug: Update av Fix https://github.com/siyuan-note/siyuan/issues/9380 --- kernel/av/table.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/av/table.go b/kernel/av/table.go index d20a6b97f40..e9d69107a65 100644 --- a/kernel/av/table.go +++ b/kernel/av/table.go @@ -804,8 +804,10 @@ func (table *Table) calcColSelect(col *TableColumn, colIndex int) { uniqueValues := map[string]bool{} for _, row := range table.Rows { if nil != row.Cells[colIndex] && nil != row.Cells[colIndex].Value && nil != row.Cells[colIndex].Value.MSelect && 0 < len(row.Cells[colIndex].Value.MSelect) && nil != row.Cells[colIndex].Value.MSelect[0] && "" != row.Cells[colIndex].Value.MSelect[0].Content { - uniqueValues[row.Cells[colIndex].Value.MSelect[0].Content] = true - countUniqueValues++ + if _, ok := uniqueValues[row.Cells[colIndex].Value.MSelect[0].Content]; !ok { + uniqueValues[row.Cells[colIndex].Value.MSelect[0].Content] = true + countUniqueValues++ + } } } col.Calc.Result = &Value{Number: NewFormattedValueNumber(float64(countUniqueValues), NumberFormatNone)}