all repos — elgit @ 487ebd62dd4784d7510f166d54b71aa64fce15a0

fork of legit: web frontend for git, written in go

refactor: modernise routes.isUnlisted

Alan Pearce
commit

487ebd62dd4784d7510f166d54b71aa64fce15a0

parent

51541e82317296c5e4c910f30bc8cea2560951c4

1 file changed, 1 insertion(+), 7 deletions(-)

changed files
M routes/util.goroutes/util.go
@@ -36,13 +36,7 @@ return
} func (d *deps) isUnlisted(name string) bool { - for _, i := range d.c.Repo.Unlisted { - if name == i { - return true - } - } - - return false + return slices.Contains(d.c.Repo.Unlisted, name) } func (d *deps) isNotAllowed(name string) bool {