Code Duplication    Length = 19-20 lines in 2 locations

modules/sitemaps/sitemap-builder.php 2 locations

@@ 233-252 (lines=20) @@
230
			)
231
		);
232
233
		if ( false === $result ) {
234
			// If no sitemap was generated, advance to the next type.
235
			Jetpack_Sitemap_State::check_in( array(
236
				'sitemap-type'  => $index_type,
237
				'last-added'    => 0,
238
				'number'        => 0,
239
				'last-modified' => '1970-01-01 00:00:00',
240
			) );
241
242
			if ( $this->logger ) {
243
				$this->logger->report( "-- Cleaning Up $sitemap_type" );
244
			}
245
246
			// Clean up old files.
247
			$this->librarian->delete_numbered_sitemap_rows_after(
248
				$state['number'], $sitemap_type
249
			);
250
251
			return;
252
		}
253
254
		// Otherwise, update the state.
255
		Jetpack_Sitemap_State::check_in( array(
@@ 329-347 (lines=19) @@
326
		);
327
328
		// If no index was built, advance to the next type and return.
329
		if ( false === $result ) {
330
			Jetpack_Sitemap_State::check_in( array(
331
				'sitemap-type'  => $next_type,
332
				'last-added'    => 0,
333
				'number'        => 0,
334
				'last-modified' => '1970-01-01 00:00:00',
335
			) );
336
337
			if ( $this->logger ) {
338
				$this->logger->report( "-- Cleaning Up $index_type" );
339
			}
340
341
			// Clean up old files.
342
			$this->librarian->delete_numbered_sitemap_rows_after(
343
				$state['number'], $index_type
344
			);
345
346
			return;
347
		}
348
349
		// Otherwise, check in the state.
350
		Jetpack_Sitemap_State::check_in( array(