diff options
author | Derek Jones <derek.jones@ellislab.com> | 2008-05-16 16:38:40 +0200 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2008-05-16 16:38:40 +0200 |
commit | 5453b8e306b6d3d0ce96bfd0cb5bbbe331084bdc (patch) | |
tree | e19e14cae09b9bed128f6e820ec4df250cf88966 | |
parent | ef40640f53351cea789a9657050422917f0b581f (diff) |
changed foreach() reindexing of segment arrays to array_unshift() - teensy tiny memory and speed improvement.
-rw-r--r-- | system/libraries/URI.php | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/system/libraries/URI.php b/system/libraries/URI.php index 4d0cd9c17..8d979d0d2 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -246,22 +246,9 @@ class CI_URI { */
function _reindex_segments()
{
- $i = 1;
-
- foreach ($this->segments as $val)
- {
- $this->segments[$i++] = $val;
- }
-
+ array_unshift($this->segments, NULL);
+ array_unshift($this->rsegments, NULL);
unset($this->segments[0]);
-
- $i = 1;
-
- foreach ($this->rsegments as $val)
- {
- $this->rsegments[$i++] = $val;
- }
-
unset($this->rsegments[0]);
}
|