Add const qualifer to check_is_dangerous

No functional change.