From 0f2798dc77b073fda099b42ca69471ba3ef6db9e Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 29 Dec 2023 16:35:40 +0100 Subject: [PATCH] Memoize --- lib/danog/PrimeModule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/danog/PrimeModule.php b/lib/danog/PrimeModule.php index 9055819..c015e03 100644 --- a/lib/danog/PrimeModule.php +++ b/lib/danog/PrimeModule.php @@ -253,7 +253,7 @@ class PrimeModule if (!extension_loaded('primemodule')) { if (class_exists(FFI::class)) { try { - self::$ffi = FFI::load('/usr/include/primemodule-ffi.h'); + self::$ffi ??= FFI::load('/usr/include/primemodule-ffi.h'); $result = self::$ffi->factorizeFFI((string) $what); if ($result > 0) { return $result;