performance: committed wrong version of buf_set_buf optimization