remove the merge pragma and obsolete comments (#20254)

remove the merge pragma which has been deprecated for seven years
This commit is contained in:
ringabout 2022-08-22 04:56:35 +08:00 • committed by GitHub
commit 2494470459
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1055,33 +1055,30 @@ proc newStringOfCap*(cap: Natural): string {.
## be achieved with the `&` operator or with `add`. ## be achieved with the `&` operator or with `add`.
proc `&`*(x: string, y: char): string {. proc `&`*(x: string, y: char): string {.
magic: "ConStrStr", noSideEffect, merge.} magic: "ConStrStr", noSideEffect.}
## Concatenates `x` with `y`. ## Concatenates `x` with `y`.
## ##
## .. code-block:: Nim ## .. code-block:: Nim
## assert("ab" & 'c' == "abc") ## assert("ab" & 'c' == "abc")
proc `&`*(x, y: char): string {. proc `&`*(x, y: char): string {.
magic: "ConStrStr", noSideEffect, merge.} magic: "ConStrStr", noSideEffect.}
## Concatenates characters `x` and `y` into a string. ## Concatenates characters `x` and `y` into a string.
## ##
## .. code-block:: Nim ## .. code-block:: Nim
## assert('a' & 'b' == "ab") ## assert('a' & 'b' == "ab")
proc `&`*(x, y: string): string {. proc `&`*(x, y: string): string {.
magic: "ConStrStr", noSideEffect, merge.} magic: "ConStrStr", noSideEffect.}
## Concatenates strings `x` and `y`. ## Concatenates strings `x` and `y`.
## ##
## .. code-block:: Nim ## .. code-block:: Nim
## assert("ab" & "cd" == "abcd") ## assert("ab" & "cd" == "abcd")
proc `&`*(x: char, y: string): string {. proc `&`*(x: char, y: string): string {.
magic: "ConStrStr", noSideEffect, merge.} magic: "ConStrStr", noSideEffect.}
## Concatenates `x` with `y`. ## Concatenates `x` with `y`.
## ##
## .. code-block:: Nim ## .. code-block:: Nim
## assert('a' & "bc" == "abc") ## assert('a' & "bc" == "abc")
# implementation note: These must all have the same magic value "ConStrStr" so
# that the merge optimization works properly.
proc add*(x: var string, y: char) {.magic: "AppendStrCh", noSideEffect.} proc add*(x: var string, y: char) {.magic: "AppendStrCh", noSideEffect.}
## Appends `y` to `x` in place. ## Appends `y` to `x` in place.
## ##