diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-09-24 02:48:35 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-09-24 02:48:35 +0000 |
commit | 0274491dea0344f39c61b8ae37e54f9df131e3e7 (patch) | |
tree | 21992a04d65e7efeab7b63e171e1fce28f387b28 /includes/common.inc | |
parent | 45acc5a46f4db5c5cbeb8308e6de3d76ff867543 (diff) | |
download | brdo-0274491dea0344f39c61b8ae37e54f9df131e3e7.tar.gz brdo-0274491dea0344f39c61b8ae37e54f9df131e3e7.tar.bz2 |
- Patch #921098 by munzirtaha: !is_null() should be replaced by isset because it's faster.
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/includes/common.inc b/includes/common.inc index 391878546..7671cd0f8 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -162,7 +162,7 @@ define('DRUPAL_CACHE_GLOBAL', 0x0008); function drupal_add_region_content($region = NULL, $data = NULL) { static $content = array(); - if (!is_null($region) && !is_null($data)) { + if (isset($region) && isset($data)) { $content[$region][] = $data; } return $content; @@ -6090,7 +6090,7 @@ function drupal_get_schema_unprocessed($module, $table = NULL) { module_load_install($module); $schema = module_invoke($module, 'schema'); - if (!is_null($table) && isset($schema[$table])) { + if (isset($table) && isset($schema[$table])) { return $schema[$table]; } elseif (!empty($schema)) { @@ -6223,7 +6223,7 @@ function drupal_write_record($table, &$record, $primary_keys = array()) { // MySQL PDO silently casts e.g. FALSE and '' to 0 when inserting the value // into an integer column, but PostgreSQL PDO does not. Also type cast NULL // when the column does not allow this. - if (!is_null($object->$field) || !empty($info['not null'])) { + if (isset($object->$field) || !empty($info['not null'])) { if ($info['type'] == 'int' || $info['type'] == 'serial') { $fields[$field] = (int) $fields[$field]; } @@ -6793,10 +6793,10 @@ function entity_create_stub_entity($entity_type, $ids) { $entity = new stdClass(); $info = entity_get_info($entity_type); $entity->{$info['entity keys']['id']} = $ids[0]; - if (!empty($info['entity keys']['revision']) && !is_null($ids[1])) { + if (!empty($info['entity keys']['revision']) && isset($ids[1])) { $entity->{$info['entity keys']['revision']} = $ids[1]; } - if (!empty($info['entity keys']['bundle']) && !is_null($ids[2])) { + if (!empty($info['entity keys']['bundle']) && isset($ids[2])) { $entity->{$info['entity keys']['bundle']} = $ids[2]; } return $entity; |