mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-24 15:41:43 +00:00
progress
This commit is contained in:
@@ -460,7 +460,9 @@ proc addInt128*(result: var string; value: Int128) =
|
||||
var i = initialSize
|
||||
var j = high(result)
|
||||
while i < j:
|
||||
swap(result[i], result[j])
|
||||
let tmp = result[i]
|
||||
result[i] = result[j]
|
||||
result[j] = tmp
|
||||
i += 1
|
||||
j -= 1
|
||||
|
||||
|
||||
@@ -574,6 +574,7 @@ proc setLengthStrV2(s: var SmallString; newLen: int) {.compilerRtl.} =
|
||||
|
||||
proc nimAsgnStrV2(a: var SmallString; b: SmallString) {.compilerRtl, inline.} =
|
||||
if ssLen(b) <= PayloadSize:
|
||||
nimDestroyStrV1(a) # free any existing heap block before overwriting
|
||||
copyMem(addr a, unsafeAddr b, sizeof(SmallString))
|
||||
else:
|
||||
if addr(a) == unsafeAddr(b): return
|
||||
|
||||
Reference in New Issue
Block a user