Optimize get_instance() calls/assignments
diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php
index e465412..5cdcdd1 100644
--- a/system/helpers/cookie_helper.php
+++ b/system/helpers/cookie_helper.php
@@ -59,8 +59,7 @@
function set_cookie($name, $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE, $httponly = FALSE)
{
// Set the config file options
- $CI =& get_instance();
- $CI->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httponly);
+ get_instance()->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httponly);
}
}
@@ -77,9 +76,8 @@
*/
function get_cookie($index, $xss_clean = FALSE)
{
- $CI =& get_instance();
$prefix = isset($_COOKIE[$index]) ? '' : config_item('cookie_prefix');
- return $CI->input->cookie($prefix.$index, $xss_clean);
+ return get_instance()->input->cookie($prefix.$index, $xss_clean);
}
}