summaryrefslogtreecommitdiffstats
path: root/system/libraries/URI.php
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-05-16 16:38:40 +0200
committerDerek Jones <derek.jones@ellislab.com>2008-05-16 16:38:40 +0200
commit5453b8e306b6d3d0ce96bfd0cb5bbbe331084bdc (patch)
treee19e14cae09b9bed128f6e820ec4df250cf88966 /system/libraries/URI.php
parentef40640f53351cea789a9657050422917f0b581f (diff)
changed foreach() reindexing of segment arrays to array_unshift() - teensy tiny memory and speed improvement.
Diffstat (limited to 'system/libraries/URI.php')
-rw-r--r--system/libraries/URI.php17
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]);
}