diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-05 14:07:58 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-05 14:07:58 +0800 |
commit | 320d25d2c43929ddcc25cb22979bbdd3aaffd3b7 (patch) | |
tree | f9f95697e5eb227016f0b99ffeb76f392e06d222 /readme_to_html.go | |
parent | CSS: Add margin-bottom on footer (diff) | |
download | forge-320d25d2c43929ddcc25cb22979bbdd3aaffd3b7.tar.gz forge-320d25d2c43929ddcc25cb22979bbdd3aaffd3b7.tar.zst forge-320d25d2c43929ddcc25cb22979bbdd3aaffd3b7.zip |
Reduce allocations when converting string to []byte
Diffstat (limited to 'readme_to_html.go')
-rw-r--r-- | readme_to_html.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/readme_to_html.go b/readme_to_html.go index e0212e9..c5cc706 100644 --- a/readme_to_html.go +++ b/readme_to_html.go @@ -35,7 +35,7 @@ func renderReadmeAtTree(tree *object.Tree) (string, template.HTML) { if err != nil { return "Error fetching README", escapeHTML("Unable to fetch contents of " + name + ": " + err.Error()) } - return renderReadme([]byte(contents), name) + return renderReadme(stringToBytes(contents), name) } return "", "" } |