Use SmallVectorImpl instead of SmallVector as method argument to avoid specifying vector size.