HPCC-10534 Optimize IF(PROJECT, PROJECT)

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>