refs #10384 fixing GCC warning and optimizing memory usage

by taking unit conversion allocator out of the loop.