mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
small optimization with generics and use os.is_dir in vweb again
This commit is contained in:
parent
4edade5067
commit
ab91733a28
2 changed files with 6 additions and 7 deletions
|
@ -1370,13 +1370,11 @@ fn (p mut Parser) save_generic_tmpl(f mut Fn, pos int) {
|
|||
fn (f &Fn) generic_tmpl_to_inst(ti TypeInst) string {
|
||||
mut fn_body := ''
|
||||
for tok in f.generic_tmpl {
|
||||
mut toks := tok.str()
|
||||
if toks in ti.inst {
|
||||
for k,v in ti.inst {
|
||||
toks = toks.replace(k, v)
|
||||
}
|
||||
mut tok_str := tok.str()
|
||||
if tok.tok == .name && tok_str in ti.inst {
|
||||
tok_str = ti.inst[tok_str]
|
||||
}
|
||||
fn_body += ' $toks'
|
||||
fn_body += ' $tok_str'
|
||||
}
|
||||
return fn_body
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue