Address review comments

This commit is contained in:
Zahary Karadjov 2019-07-31 02:31:56 +03:00
parent e4da0b36c5
commit e203f709d6
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 5 additions and 0 deletions

View File

@ -1,5 +1,10 @@
proc baseAddr*[T](x: openarray[T]): pointer = cast[pointer](x)
# 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 =
cast[pointer](cast[int](p) + delta)