Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 204-219 (lines=16) @@
201
	}
202
203
	/** SCRIPTS **/
204
	public function filter_inline_scripts( $src, $handle ) {
205
		global $wp_scripts;
206
207
		if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) {
208
			return $src;
209
		}
210
211
		$script = $wp_scripts->registered[$handle];
212
213
		// reset src to empty - can't return empty string though because then it skips rendering the tag
214
		if ( $this->should_inline_script( $script ) ) {
215
			return '#';
216
		}
217
218
		return $src;
219
	}
220
221
	public function print_inline_scripts( $tag, $handle, $src ) {
222
		global $wp_scripts;
@@ 303-317 (lines=15) @@
300
	}
301
302
	/** STYLES **/
303
	public function filter_inline_styles( $src, $handle ) {
304
		global $wp_scripts;
305
306
		if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) {
307
			return $src;
308
		}
309
310
		$style = $wp_scripts->registered[$handle];
311
312
		if ( $this->should_inline_style( $style ) ) {
313
			return '#';
314
		}
315
316
		return $src;
317
	}
318
319
	public function print_inline_styles( $tag, $handle, $href, $media ) {
320
		global $wp_styles;