Code Duplication    Length = 8-9 lines in 3 locations

includes/db/DatabasePostgres.php 1 location

@@ 818-825 (lines=8) @@
815
		if ( $multi ) {
816
			if ( $this->numericVersion >= 8.2 && !$savepoint ) {
817
				$first = true;
818
				foreach ( $args as $row ) {
819
					if ( $first ) {
820
						$first = false;
821
					} else {
822
						$sql .= ',';
823
					}
824
					$sql .= '(' . $this->makeList( $row ) . ')';
825
				}
826
				$res = (bool)$this->query( $sql, $fname, $savepoint );
827
			} else {
828
				$res = true;

includes/db/Database.php 2 locations

@@ 1614-1621 (lines=8) @@
1611
1612
		if ( $multi ) {
1613
			$first = true;
1614
			foreach ( $a as $row ) {
1615
				if ( $first ) {
1616
					$first = false;
1617
				} else {
1618
					$sql .= ',';
1619
				}
1620
				$sql .= '(' . $this->makeList( $row ) . ')';
1621
			}
1622
		} else {
1623
			$sql .= '(' . $this->makeList( $a ) . ')';
1624
		}
@@ 2296-2304 (lines=9) @@
2293
		$sql = "REPLACE INTO $table (" . implode( ',', array_keys( $rows[0] ) ) . ') VALUES ';
2294
		$first = true;
2295
2296
		foreach ( $rows as $row ) {
2297
			if ( $first ) {
2298
				$first = false;
2299
			} else {
2300
				$sql .= ',';
2301
			}
2302
2303
			$sql .= '(' . $this->makeList( $row ) . ')';
2304
		}
2305
2306
		return $this->query( $sql, $fname );
2307
	}