HPCC-12206 Avoid function call if no child expression

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #6429 from ghalliday/issue12206

HPCC-12206 Avoid function call if no child expression

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>