SACRAMENTO, Calif.—A suspect arrested in connection with last weekend’s mass shooting outside bars in Sacramento served less than half his 10-year sentence because of voter-approved changes to state law that lessened the punishment for his felony convictions and provided a chance for earlier release. Smiley Allen Martin was freed in February after serving time for punching a girlfriend, dragging her from her home by her hair, and whipping her with a belt, according to court and prison records. Those count as nonviolent offenses under California law, which considers only about two dozen crimes to be violent felonies—such as murder, rape, arson, and kidnapping. Martin, 27, was arrested Tuesday on suspicion of possession of a firearm by a prohibited person and possession of a machine gun. He is among the 12 people wounded during Sunday’s shooting, which killed six others. Police have said the violence was a shootout between rival gangs …