From 119d8a7547e155edaaa53682b9247cd7e80d8c9d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 8 Jan 2014 15:27:53 +0200 Subject: Optimize get_instance() calls/assignments --- system/helpers/cookie_helper.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'system/helpers/cookie_helper.php') diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php index e465412cf..5cdcdd137 100644 --- a/system/helpers/cookie_helper.php +++ b/system/helpers/cookie_helper.php @@ -59,8 +59,7 @@ if ( ! function_exists('set_cookie')) 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 @@ if ( ! function_exists('get_cookie')) */ 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); } } -- cgit v1.2.3-24-g4f1b