diff options
author | zeripath <art27@cantab.net> | 2021-08-23 22:23:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-23 22:23:39 +0100 |
commit | f31e7a67cfc9662af2ae2dab3f4687457545f60c (patch) | |
tree | 532a5e37ba751e710e1ee6ce271e2ac49026c6e7 /templates/repo/view_file.tmpl | |
parent | 73defbbd1c070930563f17daa9e540c44a127928 (diff) | |
download | gitea-f31e7a67cfc9662af2ae2dab3f4687457545f60c.tar.gz gitea-f31e7a67cfc9662af2ae2dab3f4687457545f60c.zip |
Just use a slice when rendering file (#16774)
Highlight currently uses a map which is memory inefficient. Switch to use a slice instead.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'templates/repo/view_file.tmpl')
-rw-r--r-- | templates/repo/view_file.tmpl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 8c73f1252b..b6198bd0e2 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -99,7 +99,8 @@ {{else}} <table> <tbody> - {{range $line, $code := .FileContent}} + {{range $idx, $code := .FileContent}} + {{$line := Add $idx 1}} <tr> <td id="L{{$line}}" class="lines-num"> <span id="L{{$line}}" data-line-number="{{$line}}"></span> |