Simplify addInt, remove digits10 (#18356)
* Simplify addInt, remove digits10 Co-authored-by: Charles Blake <charlechaud@gmail.com> * Fix bootstrapping * Add noInit to tmp array * noInit -> noinit Co-authored-by: Charles Blake <charlechaud@gmail.com>
This commit is contained in:
parent
e720bbdd76
commit
6e74fecb42
4 changed files with 27 additions and 68 deletions
|
|
@ -7,9 +7,7 @@ proc `$`*(x: int): string {.magic: "IntToStr", noSideEffect.}
|
|||
## spelling `toString`:idx:.
|
||||
|
||||
template dollarImpl(x: uint | uint64, result: var string) =
|
||||
let length = digits10(x)
|
||||
setLen(result, length)
|
||||
numToString(result, x, length)
|
||||
addIntImpl(result, x)
|
||||
|
||||
when defined(js):
|
||||
import std/private/since
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue