Replace unnecessary vector copy with reference.