Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.