Download & Extend

Remove unnecessary boolean ternary conditionals

Project:Drupal core
Version:7.x-dev
Component:base system
Category:task
Priority:minor
Assigned:Dave Reid
Status:closed (fixed)

Issue Summary

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

Comments

#1

Title:Remove unnecessary true or false ternary conditionals» Remove unnecessary boolean ternary conditionals
Status:active» needs review

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.

AttachmentSizeStatusTest resultOperations
ternary-booleans-319666-D7.patch5.48 KBIgnored: Check issue status.NoneNone

#2

Status:needs review» needs work

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

#3

Status:needs work» fixed

Committed to CVS HEAD. Thanks.

--project followup subject--

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

#4

Status:fixed» closed (fixed)

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

nobody click here