if/else chain to ternary in small code.
Those small functions that are basically a return can be transformed to a ternary without losing the readability.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>