Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
!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.
Comment | File | Size | Author |
---|---|---|---|
#3 | isset-is-faster-than-is_null-issue921098-3.patch | 1.91 KB | munzirtaha |
isset-is-faster-than-is_null.patch | 4.33 KB | munzirtaha | |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedThanks for this.
This is definitely a no brainer. Not sure how so many instances of
is_null()
slipped thru the review process... :)Comment #2
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks. common.inc failed so that might require a re-roll
Comment #3
munzirtaha CreditAttribution: munzirtaha commentedThanks Dries, another patch because the repository is changing so fast.
Comment #4
Dries CreditAttribution: Dries commentedCommitted. Thanks!
Comment #5
munzirtaha CreditAttribution: munzirtaha commentedMy first pathes acceptance encourage me to add more patches to get rid of the remaining isset's: #921582, #921606, #921626.