diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-09-24 02:10:06 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-09-24 02:10:06 +0000 |
commit | 45acc5a46f4db5c5cbeb8308e6de3d76ff867543 (patch) | |
tree | 1d1e8ad7232f801ceb32e263d8e9aaa77e6b892e /modules/field | |
parent | e0032eeee61f0cb83dbcd7e410bd85f8226b7ec7 (diff) | |
download | brdo-45acc5a46f4db5c5cbeb8308e6de3d76ff867543.tar.gz brdo-45acc5a46f4db5c5cbeb8308e6de3d76ff867543.tar.bz2 |
- Patch #921098 by munzirtaha: !is_null() should be replaced by isset() because it's faster.
Diffstat (limited to 'modules/field')
-rw-r--r-- | modules/field/field.crud.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/field/field.crud.inc b/modules/field/field.crud.inc index b9f38814d..dc5a08dfe 100644 --- a/modules/field/field.crud.inc +++ b/modules/field/field.crud.inc @@ -762,7 +762,7 @@ function _field_write_instance($instance, $update = FALSE) { // If no weight specified, make sure the field sinks at the bottom. if (!isset($instance['widget']['weight'])) { $max_weight = field_info_max_weight($instance['entity_type'], $instance['bundle'], 'form'); - $instance['widget']['weight'] = !is_null($max_weight) ? $max_weight + 1 : 0; + $instance['widget']['weight'] = isset($max_weight) ? $max_weight + 1 : 0; } // Check widget module. $widget_type = field_info_widget_types($instance['widget']['type']); @@ -788,7 +788,7 @@ function _field_write_instance($instance, $update = FALSE) { // If no weight specified, make sure the field sinks at the bottom. if (!isset($display['weight'])) { $max_weight = field_info_max_weight($instance['entity_type'], $instance['bundle'], $view_mode); - $display['weight'] = !is_null($max_weight) ? $max_weight + 1 : 0; + $display['weight'] = isset($max_weight) ? $max_weight + 1 : 0; } $instance['display'][$view_mode] = $display; } |