From 79f342b954a6f47ee3f1277a899066a654e7c330 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Wed, 4 May 2016 15:19:47 -0700 Subject: lint cleanup: eliminate "redundant" errors This removes some pointless parentheses but the primary focus is removing redundancies like unnecessary "else" clauses. --- src/color.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/color.cpp') diff --git a/src/color.cpp b/src/color.cpp index 7ab96779..7648449d 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -283,13 +283,9 @@ color24_t rgb_color_t::to_color24() const { unsigned char rgb_color_t::to_name_index() const { assert(type == type_named || type == type_rgb); - if (type == type_named) { - return data.name_idx; - } else if (type == type_rgb) { - return term8_color_for_rgb(data.color.rgb); - } else { - return (unsigned char)-1; // this is an error - } + if (type == type_named) return data.name_idx; + if (type == type_rgb) return term8_color_for_rgb(data.color.rgb); + return (unsigned char)-1; // this is an error } void rgb_color_t::parse(const wcstring &str) { -- cgit v1.2.3