Code Duplication    Length = 19-20 lines in 2 locations

modules/sitemaps/sitemap-builder.php 2 locations

@@ 297-316 (lines=20) @@
294
			)
295
		);
296
297
		if ( false === $result ) {
298
			// If no sitemap was generated, advance to the next type.
299
			Jetpack_Sitemap_State::check_in(
300
				array(
301
					'sitemap-type'  => $index_type,
302
					'last-added'    => 0,
303
					'number'        => 0,
304
					'last-modified' => '1970-01-01 00:00:00',
305
				)
306
			);
307
308
			if ( $this->logger ) {
309
				$this->logger->report( "-- Cleaning Up $sitemap_type" );
310
			}
311
312
			// Clean up old files.
313
			$this->librarian->delete_numbered_sitemap_rows_after(
314
				$state['number'],
315
				$sitemap_type
316
			);
317
318
			return;
319
		}
@@ 402-420 (lines=19) @@
399
		);
400
401
		// If no index was built, advance to the next type and return.
402
		if ( false === $result ) {
403
			Jetpack_Sitemap_State::check_in(
404
				array(
405
					'sitemap-type'  => $next_type,
406
					'last-added'    => 0,
407
					'number'        => 0,
408
					'last-modified' => '1970-01-01 00:00:00',
409
				)
410
			);
411
412
			if ( $this->logger ) {
413
				$this->logger->report( "-- Cleaning Up $index_type" );
414
			}
415
416
			// Clean up old files.
417
			$this->librarian->delete_numbered_sitemap_rows_after(
418
				$state['number'],
419
				$index_type
420
			);
421
422
			return;
423
		}