1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: simplify return if ... constructs to make more code compatible with -autofree

This commit is contained in:
Delyan Angelov
2021-03-22 16:45:29 +02:00
parent a53aaaf9e7
commit c76c69ec35
9 changed files with 129 additions and 71 deletions

View File

@ -356,7 +356,10 @@ fn html_highlight(code string, tb &table.Table) string {
} else {
tok.lit
}
return if typ in [.unone, .name] { lit } else { '<span class="token $typ">$lit</span>' }
if typ in [.unone, .name] {
return lit
}
return '<span class="token $typ">$lit</span>'
}
mut s := scanner.new_scanner(code, .parse_comments, &pref.Preferences{})
mut tok := s.scan()