You are here

protected function JSqueeze::getNextName in Minify JS 7

1 call to JSqueeze::getNextName()
JSqueeze::renameVars in lib/JSqueeze.php

File

lib/JSqueeze.php, line 992

Class

JSqueeze

Code

protected function getNextName(&$tree = array(), &$counter = false) {
  if (false === $counter) {
    $counter =& $tree['counter'];
    isset($counter) || ($counter = -1);
    $exclude = array_flip($tree['used']);
  }
  else {
    $exclude = $tree;
  }
  ++$counter;
  $len0 = strlen($this->str0);
  $len1 = strlen($this->str0);
  $name = $this->str0[$counter % $len0];
  $i = intval($counter / $len0) - 1;
  while ($i >= 0) {
    $name .= $this->str1[$i % $len1];
    $i = intval($i / $len1) - 1;
  }
  return !(isset($this->reserved[$name]) || isset($exclude[$name])) ? $name : $this
    ->getNextName($exclude, $counter);
}