summaryrefslogtreecommitdiff
path: root/modules/field
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-09-24 02:10:06 +0000
committerDries Buytaert <dries@buytaert.net>2010-09-24 02:10:06 +0000
commit45acc5a46f4db5c5cbeb8308e6de3d76ff867543 (patch)
tree1d1e8ad7232f801ceb32e263d8e9aaa77e6b892e /modules/field
parente0032eeee61f0cb83dbcd7e410bd85f8226b7ec7 (diff)
downloadbrdo-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.inc4
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;
}