From f746475e80a2734277eb1e76bb916ae3b2863423 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Sun, 28 Jul 2013 22:23:21 +0200 Subject: Form helper _attributes_to_string() micro-optimization As $attributes should be most of the times an array, let's save an is_string() call. --- system/helpers/form_helper.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'system') diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 6fca73f85..5ba5b556c 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -931,11 +931,6 @@ if ( ! function_exists('_attributes_to_string')) */ function _attributes_to_string($attributes) { - if (is_string($attributes)) - { - return ($attributes === '' ? '' : ' '.$attributes); - } - if (is_object($attributes)) { $attributes = (array) $attributes; @@ -953,6 +948,11 @@ if ( ! function_exists('_attributes_to_string')) return $atts; } + if (is_string($attributes)) + { + return ($attributes === '' ? '' : ' '.$attributes); + } + return FALSE; } } -- cgit v1.2.3-24-g4f1b