From 96e4a2e86cf2586fe70da71894cfd68a179e2deb Mon Sep 17 00:00:00 2001 From: Miroslav Vitanov Date: Tue, 1 Apr 2014 14:16:57 +0300 Subject: [PATCH] Optimize an if statement Optimized the if statment in postSend() method in default case --- class.phpmailer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/class.phpmailer.php b/class.phpmailer.php index 85d4b878..74dfa0b0 100644 --- a/class.phpmailer.php +++ b/class.phpmailer.php @@ -1024,12 +1024,12 @@ class PHPMailer case 'mail': return $this->mailSend($this->MIMEHeader, $this->MIMEBody); default: - if (method_exists($this, $this->Mailer.'Send')) { - $sendMethod = $this->Mailer.'Send'; + $sendMethod = $this->Mailer.'Send'; + if (method_exists($this, $sendMethod)) { return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody); - } else { - return $this->mailSend($this->MIMEHeader, $this->MIMEBody); } + + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); } } catch (phpmailerException $e) { $this->setError($e->getMessage());