mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-04 13:04:44 +00:00
rename prepareStrMutation to prepareMutation (#17235)
* remove unnecessary when statement * remove outdated codes * rename prepareStrMutation to prepareMutation
This commit is contained in:
@@ -169,9 +169,9 @@ proc nimPrepareStrMutationV2(s: var NimStringV2) {.compilerRtl, inline.} =
|
||||
if s.p != nil and (s.p.cap and strlitFlag) == strlitFlag:
|
||||
nimPrepareStrMutationImpl(s)
|
||||
|
||||
proc prepareStrMutation*(s: var string) {.inline.} =
|
||||
proc prepareMutation*(s: var string) {.inline.} =
|
||||
# string literals are "copy on write", so you need to call
|
||||
# `prepareStrMutation` before modifying the strings via `addr`.
|
||||
# `prepareMutation` before modifying the strings via `addr`.
|
||||
{.cast(noSideEffect).}:
|
||||
let s = unsafeAddr s
|
||||
nimPrepareStrMutationV2(cast[ptr NimStringV2](s)[])
|
||||
|
||||
Reference in New Issue
Block a user