Code Duplication    Length = 5-5 lines in 2 locations

includes/class-wc-ajax.php 2 locations

@@ 234-238 (lines=5) @@
231
232
		$chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );
233
234
		if ( isset( $_POST['shipping_method'] ) && is_array( $_POST['shipping_method'] ) ) {
235
			foreach ( $_POST['shipping_method'] as $i => $value ) {
236
				$chosen_shipping_methods[ $i ] = wc_clean( $value );
237
			}
238
		}
239
240
		WC()->session->set( 'chosen_shipping_methods', $chosen_shipping_methods );
241
@@ 286-290 (lines=5) @@
283
284
		$chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );
285
286
		if ( isset( $_POST['shipping_method'] ) && is_array( $_POST['shipping_method'] ) ) {
287
			foreach ( $_POST['shipping_method'] as $i => $value ) {
288
				$chosen_shipping_methods[ $i ] = wc_clean( $value );
289
			}
290
		}
291
292
		WC()->session->set( 'chosen_shipping_methods', $chosen_shipping_methods );
293
		WC()->session->set( 'chosen_payment_method', empty( $_POST['payment_method'] ) ? '' : $_POST['payment_method'] );