!is_null is mentioned in various files and modules. isset is well known to be faster than !is_null and should be used in case of variables instead of negating the negative to have the positive. This patch replaces all the occurrences of !is_null. If the patch got accepted and depending on the comments, I would provide a patch that replaces is_null with !isset.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Damien Tournoud’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for this.

This is definitely a no brainer. Not sure how so many instances of is_null() slipped thru the review process... :)

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks. common.inc failed so that might require a re-roll

munzirtaha’s picture

Status: Fixed » Reviewed & tested by the community
FileSize
1.91 KB

Thanks Dries, another patch because the repository is changing so fast.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

munzirtaha’s picture

My first pathes acceptance encourage me to add more patches to get rid of the remaining isset's: #921582, #921606, #921626.

Status: Fixed » Closed (fixed)
Issue tags: -performance issue

Automatically closed -- issue fixed for 2 weeks with no activity.