Code Duplication    Length = 15-16 lines in 2 locations

modules/perf/class.jetpack-perf-optimize-assets.php 2 locations

@@ 345-360 (lines=16) @@
342
	}
343
344
	/** SCRIPTS **/
345
	public function filter_inline_scripts( $src, $handle ) {
346
		global $wp_scripts;
347
348
		if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) {
349
			return $src;
350
		}
351
352
		$script = $wp_scripts->registered[$handle];
353
354
		// reset src to empty - can't return empty string though because then it skips rendering the tag
355
		if ( $this->should_inline_script( $script ) ) {
356
			return '#';
357
		}
358
359
		return $src;
360
	}
361
362
	public function print_inline_scripts( $tag, $handle, $src ) {
363
		global $wp_scripts;
@@ 448-462 (lines=15) @@
445
	}
446
447
	/** STYLES **/
448
	public function filter_inline_styles( $src, $handle ) {
449
		global $wp_scripts;
450
451
		if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) {
452
			return $src;
453
		}
454
455
		$style = $wp_scripts->registered[$handle];
456
457
		if ( $this->should_inline_style( $style ) ) {
458
			return '#';
459
		}
460
461
		return $src;
462
	}
463
464
	public function print_inline_styles( $tag, $handle, $href, $media ) {
465
		global $wp_styles;