mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🎨 块数统计
This commit is contained in:
parent
06b4d8ea26
commit
a2806ae823
2 changed files with 16 additions and 3 deletions
|
|
@ -71,7 +71,7 @@ func CountBlocks() (ret int) {
|
|||
return len(blockTrees)
|
||||
}
|
||||
|
||||
func CeilCount(count int) int {
|
||||
func CeilTreeCount(count int) int {
|
||||
if 100 > count {
|
||||
return 100
|
||||
}
|
||||
|
|
@ -84,6 +84,19 @@ func CeilCount(count int) int {
|
|||
return 500*40 + 1
|
||||
}
|
||||
|
||||
func CeilBlockCount(count int) int {
|
||||
if 5000 > count {
|
||||
return 5000
|
||||
}
|
||||
|
||||
for i := 1; i < 100; i++ {
|
||||
if count < i*10000 {
|
||||
return i * 10000
|
||||
}
|
||||
}
|
||||
return 10000*100 + 1
|
||||
}
|
||||
|
||||
func GetBlockTreeRootByPath(boxID, path string) *BlockTree {
|
||||
blockTreesLock.Lock()
|
||||
defer blockTreesLock.Unlock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue