Use f-strings in `linecounter`

This is a bit simpler and has a marginal performance gain.
This commit is contained in:
Naglis Jonaitis 2024-02-06 12:01:59 +02:00 committed by Simon Ser
parent 2a40a3f233
commit e3198ebd3b
1 changed files with 1 additions and 1 deletions

View File

@ -103,7 +103,7 @@ def _highlight_file(repo, ref, entry, data, blob_id, commit_id):
def linecounter(count):
out = []
for i in range(1, count + 1):
out.append('<a href="#L{}" id="L{}">{}\n</a>'.format(i, i, i))
out.append(f'<a href="#L{i}" id="L{i}">{i}\n</a>')
return "".join(out)
def render_empty_repo(owner, repo, view):