Code Duplication    Length = 11-11 lines in 2 locations

includes/db/DatabasePostgres.php 1 location

@@ 459-469 (lines=11) @@
456
	 * @param stdClass|ResultWrapper $res
457
	 * @throws DBUnexpectedError
458
	 */
459
	function freeResult( $res ) {
460
		if ( $res instanceof ResultWrapper ) {
461
			$res = $res->result;
462
		}
463
		MediaWiki\suppressWarnings();
464
		$ok = pg_free_result( $res );
465
		MediaWiki\restoreWarnings();
466
		if ( !$ok ) {
467
			throw new DBUnexpectedError( $this, "Unable to free Postgres result\n" );
468
		}
469
	}
470
471
	/**
472
	 * @param ResultWrapper|stdClass $res

includes/db/DatabaseMysqlBase.php 1 location

@@ 222-232 (lines=11) @@
219
	 * @param ResultWrapper|resource $res
220
	 * @throws DBUnexpectedError
221
	 */
222
	function freeResult( $res ) {
223
		if ( $res instanceof ResultWrapper ) {
224
			$res = $res->result;
225
		}
226
		MediaWiki\suppressWarnings();
227
		$ok = $this->mysqlFreeResult( $res );
228
		MediaWiki\restoreWarnings();
229
		if ( !$ok ) {
230
			throw new DBUnexpectedError( $this, "Unable to free MySQL result" );
231
		}
232
	}
233
234
	/**
235
	 * Free result memory