aboutsummaryrefslogtreecommitdiff
path: root/http_handle_repo_tree.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-30 17:56:44 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-30 17:56:44 +0800
commit9f01408ea7bb68684ec709fe1dabafd20254e055 (patch)
tree3ebc780eb406f9d41b853cfb751ad811706c22a4 /http_handle_repo_tree.go
parentAdd basic tabs to repo index (diff)
downloadforge-9f01408ea7bb68684ec709fe1dabafd20254e055.tar.gz
forge-9f01408ea7bb68684ec709fe1dabafd20254e055.tar.zst
forge-9f01408ea7bb68684ec709fe1dabafd20254e055.zip
Avoid allocations by using unsafe strinng/bytes conversions
Diffstat (limited to 'http_handle_repo_tree.go')
-rw-r--r--http_handle_repo_tree.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/http_handle_repo_tree.go b/http_handle_repo_tree.go
index 1bb9940..3c6e8df 100644
--- a/http_handle_repo_tree.go
+++ b/http_handle_repo_tree.go
@@ -39,7 +39,7 @@ func httpHandleRepoTree(writer http.ResponseWriter, request *http.Request, param
}
refHashSlice = refHash[:]
- cacheHandle := append(refHashSlice, []byte(pathSpec)...) //nolint:gocritic
+ cacheHandle := append(refHashSlice, stringToBytes(pathSpec)...) //nolint:gocritic
if value, found := treeReadmeCache.Get(cacheHandle); found {
params["files"] = value.DisplayTree