Edit the output of a filter

I’m trying to edit the output of the filter (below) in the plugin WPJobManager. I want to make sure there isn’t a duplicate company_name value in the $job_slug before it is updated. At the moment, its set to add company_name to the slug, but if you then edit the same post, it adds company_name again!

if ( apply_filters( 'submit_job_form_prefix_post_name_with_company', true ) && ! empty( $values('company')('company_name') ) ) {
        $job_slug() = $values('company')('company_name');
}

I think I need to add a filter in my functions.php but I’m not sure how to do this with an IF statement to remove the duplicate. I was thinking something like this below? Could anyone point me in the right direction?

if ( strpos( $job_slug, sanitize_title($values('company')('company_name');) ) ) {
            return;
        }