HPCC-11587 Remove extra lines and add return statements

Those changes are based on the last review comments for better
coding practice.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>