Optimize swapCards when indexes are equal