[ticket/10141] Save a hash lookup when value is not in cache.

PHPBB3-10141
This commit is contained in:
Oleg Pudeyev 2011-04-21 23:15:51 -04:00
parent b1367bce48
commit f49656986c

View file

@ -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;
}
}