diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-11-13 07:39:35 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-11-13 07:39:35 +0000 |
commit | a365b198b66bb16619ab2901538f9d044a16cdac (patch) | |
tree | c095255900b3c57526ae9d20657b3c6baae0b48b /modules/field/modules/text/text.module | |
parent | 6c3f6337ddc1ba5d2c664a396f0ddcf98c4840c5 (diff) | |
download | brdo-a365b198b66bb16619ab2901538f9d044a16cdac.tar.gz brdo-a365b198b66bb16619ab2901538f9d044a16cdac.tar.bz2 |
#617596 follow-up by sun: optimize if statement.
Diffstat (limited to 'modules/field/modules/text/text.module')
-rw-r--r-- | modules/field/modules/text/text.module | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/modules/field/modules/text/text.module b/modules/field/modules/text/text.module index c4739a4d1..08f06229c 100644 --- a/modules/field/modules/text/text.module +++ b/modules/field/modules/text/text.module @@ -170,13 +170,8 @@ function text_field_load($entity_type, $entities, $field, $instances, $langcode, * Implements hook_field_is_empty(). */ function text_field_is_empty($item, $field) { - if (empty($item['value']) && (string) $item['value'] !== '0') { - if ($field['type'] == 'text_with_summary') { - return (empty($item['summary']) && (string)$item['summary'] !== '0'); - } - else { - return TRUE; - } + if (!isset($item['value']) || $item['value'] === '') { + return !isset($item['summary']) || $item['summary'] === ''; } return FALSE; } |