Code Duplication    Length = 7-7 lines in 2 locations

includes/wpinv-discount-functions.php 2 locations

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