small refactor
Merge pull request #3494 from WalterBright/refactor-isNogc

small refactor