Code Duplication    Length = 8-9 lines in 3 locations

includes/libs/rdbms/database/Database.php 2 locations

@@ 1480-1487 (lines=8) @@
1477
1478
		if ( $multi ) {
1479
			$first = true;
1480
			foreach ( $a as $row ) {
1481
				if ( $first ) {
1482
					$first = false;
1483
				} else {
1484
					$sql .= ',';
1485
				}
1486
				$sql .= '(' . $this->makeList( $row ) . ')';
1487
			}
1488
		} else {
1489
			$sql .= '(' . $this->makeList( $a ) . ')';
1490
		}
@@ 2138-2146 (lines=9) @@
2135
		$sql = "REPLACE INTO $table (" . implode( ',', array_keys( $rows[0] ) ) . ') VALUES ';
2136
		$first = true;
2137
2138
		foreach ( $rows as $row ) {
2139
			if ( $first ) {
2140
				$first = false;
2141
			} else {
2142
				$sql .= ',';
2143
			}
2144
2145
			$sql .= '(' . $this->makeList( $row ) . ')';
2146
		}
2147
2148
		return $this->query( $sql, $fname );
2149
	}

includes/libs/rdbms/database/DatabasePostgres.php 1 location

@@ 575-582 (lines=8) @@
572
		if ( $multi ) {
573
			if ( $this->numericVersion >= 8.2 && !$savepoint ) {
574
				$first = true;
575
				foreach ( $args as $row ) {
576
					if ( $first ) {
577
						$first = false;
578
					} else {
579
						$sql .= ',';
580
					}
581
					$sql .= '(' . $this->makeList( $row ) . ')';
582
				}
583
				$res = (bool)$this->query( $sql, $fname, $savepoint );
584
			} else {
585
				$res = true;