[Core] Optimize NthOrder promotion checker.