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>
This commit is contained in:
zeripath 2021-08-23 22:23:39 +01:00 committed by GitHub
parent 73defbbd1c
commit f31e7a67cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 42 deletions

View file

@ -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>