Code Duplication    Length = 7-7 lines in 2 locations

includes/wpinv-discount-functions.php 2 locations

@@ 236-242 (lines=7) @@
233
        unset( $meta['uses'] );
234
    }
235
    
236
    if ( ! empty( $meta['items'] ) ) {
237
        foreach ( $meta['items'] as $key => $item ) {
238
            if ( 0 === intval( $item ) ) {
239
                unset( $meta['items'][ $key ] );
240
            }
241
        }
242
    }
243
    
244
    if ( ! empty( $meta['excluded_items'] ) ) {
245
        foreach ( $meta['excluded_items'] as $key => $item ) {
@@ 244-250 (lines=7) @@
241
        }
242
    }
243
    
244
    if ( ! empty( $meta['excluded_items'] ) ) {
245
        foreach ( $meta['excluded_items'] as $key => $item ) {
246
            if ( 0 === intval( $item ) ) {
247
                unset( $meta['excluded_items'][ $key ] );
248
            }
249
        }
250
    }
251
    
252
    $meta = apply_filters( 'wpinv_update_discount', $meta, $post_id, $post );
253