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

@@ 1622-1629 (lines=8) @@
1619
1620
		if ( $multi ) {
1621
			$first = true;
1622
			foreach ( $a as $row ) {
1623
				if ( $first ) {
1624
					$first = false;
1625
				} else {
1626
					$sql .= ',';
1627
				}
1628
				$sql .= '(' . $this->makeList( $row ) . ')';
1629
			}
1630
		} else {
1631
			$sql .= '(' . $this->makeList( $a ) . ')';
1632
		}
@@ 2334-2342 (lines=9) @@
2331
		$sql = "REPLACE INTO $table (" . implode( ',', array_keys( $rows[0] ) ) . ') VALUES ';
2332
		$first = true;
2333
2334
		foreach ( $rows as $row ) {
2335
			if ( $first ) {
2336
				$first = false;
2337
			} else {
2338
				$sql .= ',';
2339
			}
2340
2341
			$sql .= '(' . $this->makeList( $row ) . ')';
2342
		}
2343
2344
		return $this->query( $sql, $fname );
2345
	}