Since xz version 5.6.0 -T,--threads is set to 0 by default so this code can be simplified.
-T,--threads
Ref https://git.tukaani.org/?p=xz.git;a=blob;f=NEWS;h=478b24b26e2a2f91dde42c27490c009a62739a2b;hb=HEAD#l416