Random Ternaries
AbandonedPublic

Authored by tcanabrava on Jul 2 2018, 12:41 PM.

Details

Reviewers
hindenburg
Group Reviewers
Konsole
Summary

replace some else / if constructs to ternaries where it made sense.
This makes the code easier to read, removes the usage of temporaries and reduces loc count.

Diff Detail

Repository
R319 Konsole
Branch
bookmarkHandlerTernaries
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 789
Build 802: arc lint + arc unit
tcanabrava created this revision.Jul 2 2018, 12:41 PM
Restricted Application added a project: Konsole. · View Herald TranscriptJul 2 2018, 12:41 PM
Restricted Application added a subscriber: konsole-devel. · View Herald Transcript
tcanabrava requested review of this revision.Jul 2 2018, 12:41 PM
tcanabrava edited the summary of this revision. (Show Details)Jul 10 2018, 8:56 AM
tcanabrava added reviewers: hindenburg, Konsole.

I don't mind the smaller ones, but I'm not 100% sure about some of the multi-line ones.

Also, we use the ==nullptr per "readability-implicit-bool-cast" - I think it makes the code easier to understand and avoids confusion about what you're checking (implicit casts).

Also, we use the ==nullptr per "readability-implicit-bool-cast" - I think it makes the code easier to understand and avoids confusion about what you're checking (implicit casts).

I'll update on that.

Specially for the multiline ones ternaries can improve readability if we are only doing a single variable value assignmnent.

tcanabrava updated this revision to Diff 37664.Jul 12 2018, 4:33 PM
  • Be more explicit
tcanabrava abandoned this revision.Aug 28 2018, 3:00 PM

Stale for too long.