Evolutionary dynamics in the voting game