Merge "Avoid DB_MASTER queries in User::newSystemUser() when possible"
[lhc/web/wiklou.git] / maintenance / benchmarks / Benchmarker.php
index 638e47e..0039d20 100644 (file)
@@ -45,6 +45,11 @@ abstract class Benchmarker extends Maintenance {
                $this->startBench();
                $count = $this->getOption( 'count', $this->defaultCount );
                foreach ( $benchs as $key => $bench ) {
+                       // Shortcut for simple functions
+                       if ( is_callable( $bench ) ) {
+                               $bench = [ 'function' => $bench ];
+                       }
+
                        // Default to no arguments
                        if ( !isset( $bench['args'] ) ) {
                                $bench['args'] = [];