inlining swap