Intention action: ternary expression with constant


Hi JB,

could we please have an intention for replacing an expression like


with


(and similar ones for the other cases where one or the other
branch of a ternary expression is one or the other boolean
constant)?

Thanks in advance,
Jens

3 comments
Comment actions Permalink

Sounds like an IPP thing -- I don't see many reasons for something like this to be on the core.

Using a logical operator instead of the ternary doesn't provide any performance benefits, nor improves reading -- all in all, I'd say this is just a stylistic preference. Feel free to write a plugin yourself, shouldn't be hard to do.

0
Comment actions Permalink

Please post a request to JIRA. I can't say it'll get a very high priority, but if it's not in JIRA I will lose it.

--Dave Griffith

0
Comment actions Permalink

http://www.jetbrains.net/jira/browse/IDEA-3478

I had the same idea just a few days ago, so I second this request.

0

Please sign in to leave a comment.