From 5453b8e306b6d3d0ce96bfd0cb5bbbe331084bdc Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 16 May 2008 14:38:40 +0000 Subject: changed foreach() reindexing of segment arrays to array_unshift() - teensy tiny memory and speed improvement. --- system/libraries/URI.php | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'system/libraries/URI.php') 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]); } -- cgit v1.2.3-24-g4f1b