From f49656986cc1898e85d6d7e4cd859ec8e980dc4a Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 21 Apr 2011 23:15:51 -0400 Subject: [PATCH] [ticket/10141] Save a hash lookup when value is not in cache. PHPBB3-10141 --- phpBB/includes/auth.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 4b13c6be7f..8324cb4977 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -126,13 +126,17 @@ class auth while ($subseq = substr($seq, $i, 6)) { - if (!isset($seq_cache[$subseq])) + if (isset($seq_cache[$subseq])) { - $seq_cache[$subseq] = str_pad(base_convert($subseq, 36, 2), 31, 0, STR_PAD_LEFT); + $converted = $seq_cache[$subseq]; + } + else + { + $converted = $seq_cache[$subseq] = str_pad(base_convert($subseq, 36, 2), 31, 0, STR_PAD_LEFT); } // We put the original bitstring into the acl array - $this->acl[$f] .= $seq_cache[$subseq]; + $this->acl[$f] .= $converted; $i += 6; } }