Remove unnecessary boolean ternary conditionals

Dave Reid - October 10, 2008 - 16:41
Project:Drupal
Version:7.x-dev
Component:base system
Category:task
Priority:minor
Assigned:Dave Reid
Status:closed
Description

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

#1

Dave Reid - October 10, 2008 - 16:49
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 KBIgnoredNoneNone

#2

earnie - October 13, 2008 - 00:37
Status:needs review» needs work

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

#3

Dries - October 29, 2008 - 10:09
Status:needs work» fixed

Committed to CVS HEAD. Thanks.

--project followup subject--

Anonymous (not verified) - November 12, 2008 - 10:13

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

#4

Anonymous (not verified) - November 12, 2008 - 10:23
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.