This version can be more efficient when this method is called many times, since it does not require allocating a new vector on each call.
See Implementation
This version can be more efficient when this method is called many times, since it does not require allocating a new vector on each call.