Optimize get_instance() calls/assignments
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index b0f4368..2d92897 100644
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -91,8 +91,7 @@
*/
function current_url()
{
- $CI =& get_instance();
- return $CI->config->site_url($CI->uri->uri_string());
+ return get_instance()->config->site_url($CI->uri->uri_string());
}
}
@@ -109,8 +108,7 @@
*/
function uri_string()
{
- $CI =& get_instance();
- return $CI->uri->uri_string();
+ return get_instance()->uri->uri_string();
}
}
@@ -127,8 +125,7 @@
*/
function index_page()
{
- $CI =& get_instance();
- return $CI->config->item('index_page');
+ return get_instance()->config->item('index_page');
}
}