Do not optimize prematurely. In many scenarios, the performance of the builder class execution will not be a bottleneck.
Typically, the difficulty of copying a card is O(n) . From the comments, it seems that n is small. If you have determined that you really need to optimize, then in this case using two vectors will be cheaper both when accessing elements and when copying.
source share