UrnSampler.sample(): use if constexpr

2 jobs for master in 105 minutes and 26 seconds
Status Job ID Name Coverage
  Test
passed #4902
amd64
job_clang_amd64

01:45:26

passed #4901
amd64
job_gcc_amd64

00:56:52