scrambler: improve the code wrt. restrictions

  * src/scrambler.cc (scramble): here, don't duplicate code.