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

@@ 239-249 (lines=11) @@
236
	 * @param ResultWrapper|resource $res
237
	 * @throws DBUnexpectedError
238
	 */
239
	function freeResult( $res ) {
240
		if ( $res instanceof ResultWrapper ) {
241
			$res = $res->result;
242
		}
243
		MediaWiki\suppressWarnings();
244
		$ok = $this->mysqlFreeResult( $res );
245
		MediaWiki\restoreWarnings();
246
		if ( !$ok ) {
247
			throw new DBUnexpectedError( $this, "Unable to free MySQL result" );
248
		}
249
	}
250
251
	/**
252
	 * Free result memory