[Olena-patches] 2791: Rewrite not_inplace.