From a7d1ad4d246b316c45b5ef882580869f85e19aa7 Mon Sep 17 00:00:00 2001 From: Derick Alangi Date: Mon, 25 Mar 2019 00:14:49 +0100 Subject: [PATCH] db: Use variable functions/callbacks instead of call_user_func() Performance-wise, this gives a little boost in performance and also it's more readable I think. But I could be wrong so please someone let me know. See: https://www.php.net/manual/en/function.call-user-func.php Change-Id: I2f0a00408c29549a786b56792411f88998a5f003 --- includes/db/DatabaseOracle.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 16bde4b959..cfc9e2949b 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -969,7 +969,7 @@ class DatabaseOracle extends Database { // Defines must comply with ^define\s*([^\s=]*)\s*=\s?'\{\$([^\}]*)\}'; while ( !feof( $fp ) ) { if ( $lineCallback ) { - call_user_func( $lineCallback ); + $lineCallback(); } $line = trim( fgets( $fp, 1024 ) ); $sl = strlen( $line ) - 1; @@ -1015,7 +1015,7 @@ class DatabaseOracle extends Database { $cmd = $this->replaceVars( $cmd ); if ( $inputCallback ) { - call_user_func( $inputCallback, $cmd ); + $inputCallback( $cmd ); } $res = $this->doQuery( $cmd ); if ( $resultCallback ) { -- 2.20.1