Code Duplication    Length = 19-20 lines in 2 locations

modules/sitemaps/sitemap-builder.php 2 locations

@@ 256-275 (lines=20) @@
253
			)
254
		);
255
256
		if ( false === $result ) {
257
			// If no sitemap was generated, advance to the next type.
258
			Jetpack_Sitemap_State::check_in( array(
259
				'sitemap-type'  => $index_type,
260
				'last-added'    => 0,
261
				'number'        => 0,
262
				'last-modified' => '1970-01-01 00:00:00',
263
			) );
264
265
			if ( $this->logger ) {
266
				$this->logger->report( "-- Cleaning Up $sitemap_type" );
267
			}
268
269
			// Clean up old files.
270
			$this->librarian->delete_numbered_sitemap_rows_after(
271
				$state['number'], $sitemap_type
272
			);
273
274
			return;
275
		}
276
277
		// Otherwise, update the state.
278
		Jetpack_Sitemap_State::check_in( array(
@@ 350-368 (lines=19) @@
347
		);
348
349
		// If no index was built, advance to the next type and return.
350
		if ( false === $result ) {
351
			Jetpack_Sitemap_State::check_in( array(
352
				'sitemap-type'  => $next_type,
353
				'last-added'    => 0,
354
				'number'        => 0,
355
				'last-modified' => '1970-01-01 00:00:00',
356
			) );
357
358
			if ( $this->logger ) {
359
				$this->logger->report( "-- Cleaning Up $index_type" );
360
			}
361
362
			// Clean up old files.
363
			$this->librarian->delete_numbered_sitemap_rows_after(
364
				$state['number'], $index_type
365
			);
366
367
			return;
368
		}
369
370
		// Otherwise, check in the state.
371
		Jetpack_Sitemap_State::check_in( array(