Code Duplication    Length = 12-14 lines in 2 locations

includes/api/ApiQueryRevisions.php 2 locations

@@ 320-333 (lines=14) @@
317
		$res = $this->select( __METHOD__, [], $hookData );
318
319
		foreach ( $res as $row ) {
320
			if ( ++$count > $this->limit ) {
321
				// We've reached the one extra which shows that there are
322
				// additional pages to be had. Stop here...
323
				if ( $enumRevMode ) {
324
					$this->setContinueEnumParameter( 'continue',
325
						$row->rev_timestamp . '|' . intval( $row->rev_id ) );
326
				} elseif ( $revCount > 0 ) {
327
					$this->setContinueEnumParameter( 'continue', intval( $row->rev_id ) );
328
				} else {
329
					$this->setContinueEnumParameter( 'continue', intval( $row->rev_page ) .
330
						'|' . intval( $row->rev_id ) );
331
				}
332
				break;
333
			}
334
335
			if ( $resultPageSet !== null ) {
336
				$generated[] = $row->rev_id;
@@ 356-367 (lines=12) @@
353
354
				$fit = $this->processRow( $row, $rev, $hookData ) &&
355
					$this->addPageSubItem( $row->rev_page, $rev, 'rev' );
356
				if ( !$fit ) {
357
					if ( $enumRevMode ) {
358
						$this->setContinueEnumParameter( 'continue',
359
							$row->rev_timestamp . '|' . intval( $row->rev_id ) );
360
					} elseif ( $revCount > 0 ) {
361
						$this->setContinueEnumParameter( 'continue', intval( $row->rev_id ) );
362
					} else {
363
						$this->setContinueEnumParameter( 'continue', intval( $row->rev_page ) .
364
							'|' . intval( $row->rev_id ) );
365
					}
366
					break;
367
				}
368
			}
369
		}
370