summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-10-08 01:20:53 +0800
committerGitHub <noreply@github.com>2022-10-08 01:20:53 +0800
commitc08e42c47ef2a32b3b7ee422c73d6929c93b199e (patch)
tree7425d3fa27e7ac65de4f251ed22db1511b21adc4 /routers
parent69fc510d6dcf9cda7993eae8cd5c7725b345a9a1 (diff)
downloadgitea-c08e42c47ef2a32b3b7ee422c73d6929c93b199e.tar.gz
gitea-c08e42c47ef2a32b3b7ee422c73d6929c93b199e.zip
Refactor parseTreeEntries, speed up tree list (#21368)
Close #20315 (fix the panic when parsing invalid input), Speed up #20231 (use ls-tree without size field) Introduce ListEntriesRecursiveFast (ls-tree without size) and ListEntriesRecursiveWithSize (ls-tree with size)
Diffstat (limited to 'routers')
-rw-r--r--routers/web/repo/treelist.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/repo/treelist.go b/routers/web/repo/treelist.go
index 35ac0d507f..80f43a0c40 100644
--- a/routers/web/repo/treelist.go
+++ b/routers/web/repo/treelist.go
@@ -22,9 +22,9 @@ func TreeList(ctx *context.Context) {
return
}
- entries, err := tree.ListEntriesRecursive()
+ entries, err := tree.ListEntriesRecursiveFast()
if err != nil {
- ctx.ServerError("ListEntriesRecursive", err)
+ ctx.ServerError("ListEntriesRecursiveFast", err)
return
}
entries.CustomSort(base.NaturalSortLess)