Use the ternary operator meant for this purpose rather than two returns

Change-Id: Ie6b17d95b83ad751130305a6d44cdead3cd46da6
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>