From 9f01408ea7bb68684ec709fe1dabafd20254e055 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 30 Mar 2025 17:56:44 +0800 Subject: Avoid allocations by using unsafe strinng/bytes conversions --- http_handle_repo_raw.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'http_handle_repo_raw.go') diff --git a/http_handle_repo_raw.go b/http_handle_repo_raw.go index aab64b6..1b4181b 100644 --- a/http_handle_repo_raw.go +++ b/http_handle_repo_raw.go @@ -33,7 +33,7 @@ func httpHandleRepoRaw(writer http.ResponseWriter, request *http.Request, params } 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 -- cgit v1.2.3