benchmark: refactor to remove duplicate code
The dns benchmark script contained an if-then-else branch which executed almost the same code in both cases, apart from the number of args passed to the core dns lookup function.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines