diff options
author | Kurtis Rader <krader@skepticism.us> | 2016-05-04 15:19:47 -0700 |
---|---|---|
committer | Kurtis Rader <krader@skepticism.us> | 2016-05-04 15:32:04 -0700 |
commit | 79f342b954a6f47ee3f1277a899066a654e7c330 (patch) | |
tree | a9386ce1e108a5c046276e4266e0129404fc4ea0 /src/color.cpp | |
parent | 527e5f52ba5a097a24490065fea23b4627032e4c (diff) |
lint cleanup: eliminate "redundant" errors
This removes some pointless parentheses but the primary focus is removing
redundancies like unnecessary "else" clauses.
Diffstat (limited to 'src/color.cpp')
-rw-r--r-- | src/color.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
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) { |