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
		}
@@ 2132-2140 (lines=9) @@
2129
		$sql = "REPLACE INTO $table (" . implode( ',', array_keys( $rows[0] ) ) . ') VALUES ';
2130
		$first = true;
2131
2132
		foreach ( $rows as $row ) {
2133
			if ( $first ) {
2134
				$first = false;
2135
			} else {
2136
				$sql .= ',';
2137
			}
2138
2139
			$sql .= '(' . $this->makeList( $row ) . ')';
2140
		}
2141
2142
		return $this->query( $sql, $fname );
2143
	}

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

@@ 618-625 (lines=8) @@
615
		if ( $multi ) {
616
			if ( $this->numericVersion >= 8.2 && !$savepoint ) {
617
				$first = true;
618
				foreach ( $args as $row ) {
619
					if ( $first ) {
620
						$first = false;
621
					} else {
622
						$sql .= ',';
623
					}
624
					$sql .= '(' . $this->makeList( $row ) . ')';
625
				}
626
				$res = (bool)$this->query( $sql, $fname, $savepoint );
627
			} else {
628
				$res = true;