Did you mean to use the memory buffer in the two branches when you changed this? Otherwise the previous code was probably better.  This could alternate between building the two different send values.