summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorvlakoff <vlakoff@gmail.com>2013-07-28 22:23:21 +0200
committervlakoff <vlakoff@gmail.com>2013-07-28 22:23:21 +0200
commitf746475e80a2734277eb1e76bb916ae3b2863423 (patch)
treed0a50705f872be35eb95e7c7e6911b21d3c4f83e /system
parentcccee50381def0777057e9b5803f7f26156c3d8e (diff)
Form helper _attributes_to_string() micro-optimization
As $attributes should be most of the times an array, let's save an is_string() call.
Diffstat (limited to 'system')
-rw-r--r--system/helpers/form_helper.php10
1 files changed, 5 insertions, 5 deletions
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;
}
}