newStringOfCap implemented and used to optimize some procs
This commit is contained in:
parent
1893f4101a
commit
d2e2d71d05
10 changed files with 53 additions and 21 deletions
|
|
@ -990,7 +990,13 @@ proc evalMagicOrCall(c: PEvalContext, n: PNode): PNode =
|
|||
var a = result
|
||||
result = newNodeIT(nkStrLit, n.info, n.typ)
|
||||
result.strVal = newString(int(getOrdValue(a)))
|
||||
else:
|
||||
of mNewStringOfCap:
|
||||
result = evalAux(c, n.sons[1], {})
|
||||
if isSpecial(result): return
|
||||
var a = result
|
||||
result = newNodeIT(nkStrLit, n.info, n.typ)
|
||||
result.strVal = newString(0)
|
||||
else:
|
||||
result = evalAux(c, n.sons[1], {})
|
||||
if isSpecial(result): return
|
||||
var a = result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue