Did a search for statements similar to expression ? TRUE : FALSE, and just replaced it with (bool) expression for simplicity.

CommentFileSizeAuthor
#1 ternary-booleans-319666-1-D7.patch5.48 KBDave Reid
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Title: Remove unnecessary true or false ternary conditionals » Remove unnecessary boolean ternary conditionals
Status: Active » Needs review
FileSize
5.48 KB

Patch replaces any condition ? TRUE : FALSE or condition ? FALSE : TRUE ternary conditionals. I did a search for condition ? 0 : 1 and similar, but I'm not sure if I should replace those. Having to cast a boolean result to an int seems more complex than using the ternary in those cases.

Anonymous’s picture

Status: Needs review » Needs work

This looks good. It contains some space clean-up which is under a different issue.

Dries’s picture

Status: Needs work » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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