Code Duplication    Length = 15-16 lines in 2 locations

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

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