From ad9f232e7b9573496509c11efd70f29781d50429 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 23 Feb 2016 09:02:51 +0100 Subject: [PATCH] CustomVariableNumber: faster diff on type mismatch --- library/Director/CustomVariable/CustomVariableNumber.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/Director/CustomVariable/CustomVariableNumber.php b/library/Director/CustomVariable/CustomVariableNumber.php index 035ab4c4..e04632ea 100644 --- a/library/Director/CustomVariable/CustomVariableNumber.php +++ b/library/Director/CustomVariable/CustomVariableNumber.php @@ -8,6 +8,10 @@ class CustomVariableNumber extends CustomVariable { public function equals(CustomVariable $var) { + if (! $var instanceof CustomVariableNumber) { + return false; + } + return $var->getValue() === $this->getValue(); }