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

@@ 1449-1456 (lines=8) @@
1446
1447
		if ( $multi ) {
1448
			$first = true;
1449
			foreach ( $a as $row ) {
1450
				if ( $first ) {
1451
					$first = false;
1452
				} else {
1453
					$sql .= ',';
1454
				}
1455
				$sql .= '(' . $this->makeList( $row ) . ')';
1456
			}
1457
		} else {
1458
			$sql .= '(' . $this->makeList( $a ) . ')';
1459
		}
@@ 2122-2130 (lines=9) @@
2119
		$sql = "REPLACE INTO $table (" . implode( ',', array_keys( $rows[0] ) ) . ') VALUES ';
2120
		$first = true;
2121
2122
		foreach ( $rows as $row ) {
2123
			if ( $first ) {
2124
				$first = false;
2125
			} else {
2126
				$sql .= ',';
2127
			}
2128
2129
			$sql .= '(' . $this->makeList( $row ) . ')';
2130
		}
2131
2132
		return $this->query( $sql, $fname );
2133
	}