Improved implementation of buffer snocAll