Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 178-193 (lines=16) @@
175
	}
176
177
	/** SCRIPTS **/
178
	public function filter_inline_scripts( $src, $handle ) {
179
		global $wp_scripts;
180
181
		if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) {
182
			return $src;
183
		}
184
185
		$script = $wp_scripts->registered[$handle];
186
187
		// reset src to empty - can't return empty string though because then it skips rendering the tag
188
		if ( $this->should_inline_script( $script ) ) {
189
			return '#';
190
		}
191
192
		return $src;
193
	}
194
195
	public function print_inline_scripts( $tag, $handle, $src ) {
196
		global $wp_scripts;
@@ 258-272 (lines=15) @@
255
	}
256
257
	/** STYLES **/
258
	public function filter_inline_styles( $src, $handle ) {
259
		global $wp_scripts;
260
261
		if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) {
262
			return $src;
263
		}
264
265
		$style = $wp_scripts->registered[$handle];
266
267
		if ( $this->should_inline_style( $style ) ) {
268
			return '#';
269
		}
270
271
		return $src;
272
	}
273
274
	public function print_inline_styles( $tag, $handle, $href, $media ) {
275
		global $wp_styles;