From 5a1edb83b7107473ed7ecb63d68f71a1f893b4af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Pe=CC=81rez?= <jaime.perez@uninett.no> Date: Sat, 2 Jul 2016 18:31:22 +0200 Subject: [PATCH] Remove superfluous code. If we just called isset() on SimpleSAML_Session::$instance, and it returned false as we continued execution, it makes no sense to get the "previous" instance since it will always be null. We can just check that $instance is not null later. --- lib/SimpleSAML/Session.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php index 241b70578..2690be792 100644 --- a/lib/SimpleSAML/Session.php +++ b/lib/SimpleSAML/Session.php @@ -194,7 +194,7 @@ class SimpleSAML_Session } // check if we have stored a session stored with the session handler - $prev = (self::$instance !== null); + $session = null; try { $session = self::getSession(); @@ -223,7 +223,7 @@ class SimpleSAML_Session * error message). This means we don't need to create a new session again, we can use the one that's loaded now * instead. */ - if (self::$instance !== null && !$prev) { + if (self::$instance !== null) { return self::$instance; } -- GitLab