From e203f709d6d8faaec47546692b4293f24414dfb6 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Wed, 31 Jul 2019 02:31:56 +0300 Subject: [PATCH] Address review comments --- stew/ranges/ptr_arith.nim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stew/ranges/ptr_arith.nim b/stew/ranges/ptr_arith.nim index af00202..fe10922 100644 --- a/stew/ranges/ptr_arith.nim +++ b/stew/ranges/ptr_arith.nim @@ -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)