convert duplicative attempt at a do-while into a breakable infinity loop
more idiomatic this way. also tear apart the excessively long = || assignment into two assignments to make it easier on the eyes