[eluser]coolfactor[/eluser]
The _reindex_segments() function is a tad long in the tooth for what it does.
Here is the current version:
Code:
function _reindex_segments()
{
$i = 1;
foreach ($this->segments as $val)
{
$this->segments[$i++] = $val;
}
unset($this->segments[0]);
$i = 1;
foreach ($this->rsegments as $val)
{
$this->rsegments[$i++] = $val;
}
unset($this->rsegments[0]);
}
The same thing can be accomplished in fewer lines using native PHP functions. No need for the overhead of looping:
Code:
function _reindex_segments() {
array_unshift($this->segments, NULL);
unset($this->segments[0]);
array_unshift($this->rsegments, NULL);
unset($this->rsegments[0];
}