Code Duplication    Length = 15-16 lines in 2 locations

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

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