aboutsummaryrefslogtreecommitdiff
path: root/http_handle_repo_index.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 14:07:58 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 14:07:58 +0800
commit320d25d2c43929ddcc25cb22979bbdd3aaffd3b7 (patch)
treef9f95697e5eb227016f0b99ffeb76f392e06d222 /http_handle_repo_index.go
parentCSS: Add margin-bottom on footer (diff)
downloadforge-320d25d2c43929ddcc25cb22979bbdd3aaffd3b7.tar.gz
forge-320d25d2c43929ddcc25cb22979bbdd3aaffd3b7.tar.zst
forge-320d25d2c43929ddcc25cb22979bbdd3aaffd3b7.zip
Reduce allocations when converting string to []byte
Diffstat (limited to 'http_handle_repo_index.go')
-rw-r--r--http_handle_repo_index.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/http_handle_repo_index.go b/http_handle_repo_index.go
index 36e71d7..b0a5899 100644
--- a/http_handle_repo_index.go
+++ b/http_handle_repo_index.go
@@ -45,7 +45,7 @@ func httpHandleRepoIndex(w http.ResponseWriter, req *http.Request, params map[st
writer := bare.NewWriter(conn)
reader := bare.NewReader(conn)
- if err := writer.WriteData([]byte(repoPath)); err != nil {
+ if err := writer.WriteData(stringToBytes(repoPath)); err != nil {
errorPage500(w, params, "sending repo path failed: "+err.Error())
return
}