removed newString proc again, reverted some unnecesary changes

This commit is contained in:
Arne Döring 2017-06-06 21:19:50 +02:00
commit ddea990a70
8 changed files with 16 additions and 38 deletions

View file

@ -21,9 +21,9 @@ proc toStrMaxPrecision*(f: BiggestFloat, literalPostfix = ""): string =
if f > 0.0: result = "INF"
else: result = "-INF"
else:
result = newString(80)
let newLen = c_snprintf(result[0].addr, 81, "%#.16e" & literalPostfix, f)
result.setLen(newLen)
var buf: array[0..80, char]
let newLen = c_snprintf(buf.cstring, buf.len.uint, "%#.16e%s", f, literalPostfix.cstring)
result = $buf.cstring
proc encodeStr*(s: string, result: var string) =
for i in countup(0, len(s) - 1):