mirror of
https://github.com/status-im/nim-stew.git
synced 2025-01-09 11:45:42 +00:00
d087c039c2
* return `nil` for empty openArrays / avoid returning `16` * move to `ptrops`, deprecate `ptr_arith` fully
16 lines
523 B
Nim
16 lines
523 B
Nim
{.deprecated: "use stew/ptrops".}
|
|
|
|
import ../ptrops
|
|
export ptrops
|
|
|
|
# Please note that we use templates here on purpose.
|
|
# As much as I believe in the power of optimizing compilers, it turned
|
|
# out that the use of forced inlining with templates still creates a
|
|
# significant difference in the release builds of nim-faststreams
|
|
|
|
template shift*(p: pointer, delta: int): pointer {.deprecated: "use ptrops".} =
|
|
p.offset(delta)
|
|
|
|
template shift*[T](p: ptr T, delta: int): ptr T {.deprecated: "use ptrops".} =
|
|
p.offset(delta)
|