Small efficiency fix - move command out of loop.

Change-Id: I790c3a8363f611ca10c6d816613848ec6f39c515
Reviewed-on: https://gerrit.libreoffice.org/7465
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>