Fixes #5213: Add class_noop generic_method

If you don't have any prefixes to set, there's no need to keep the variable. Remove this and the logic below.