aboutsummaryrefslogtreecommitdiff
path: root/http_handle_repo_index.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 14:09:15 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 14:09:15 +0800
commit98826d198b228e725ceb5a9fcf1d936ad3817d8e (patch)
treeba1840795c2b46529128945f80a548f11daf9c00 /http_handle_repo_index.go
parentReduce allocations when converting string to []byte (diff)
downloadforge-0.1.22.tar.gz
forge-0.1.22.tar.zst
forge-0.1.22.zip
Reduce unnecessary allocations when converting []byte to stringv0.1.22
Diffstat (limited to 'http_handle_repo_index.go')
-rw-r--r--http_handle_repo_index.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/http_handle_repo_index.go b/http_handle_repo_index.go
index b0a5899..8f0a62b 100644
--- a/http_handle_repo_index.go
+++ b/http_handle_repo_index.go
@@ -91,10 +91,10 @@ func httpHandleRepoIndex(w http.ResponseWriter, req *http.Request, params map[st
commits = append(commits, commitDisplay{
Hash: hex.EncodeToString(id),
- Author: string(authorName),
- Email: string(authorEmail),
- Date: string(authorDate),
- Message: string(title),
+ Author: bytesToString(authorName),
+ Email: bytesToString(authorEmail),
+ Date: bytesToString(authorDate),
+ Message: bytesToString(title),
})
}