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/output.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/output.cpp') diff --git a/src/output.cpp b/src/output.cpp index 935efe96..78ea210b 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -58,9 +58,8 @@ void output_set_color_support(color_support_t val) { color_support = val; } unsigned char index_for_color(rgb_color_t c) { if (c.is_named() || !(output_get_color_support() & color_support_term256)) { return c.to_name_index(); - } else { - return c.to_term256_index(); } + return c.to_term256_index(); } static bool write_color_escape(char *todo, unsigned char idx, bool is_fg) { @@ -95,9 +94,8 @@ static bool write_foreground_color(unsigned char idx) { return write_color_escape(set_a_foreground, idx, true); } else if (set_foreground && set_foreground[0]) { return write_color_escape(set_foreground, idx, true); - } else { - return false; } + return false; } static bool write_background_color(unsigned char idx) { @@ -105,9 +103,8 @@ static bool write_background_color(unsigned char idx) { return write_color_escape(set_a_background, idx, false); } else if (set_background && set_background[0]) { return write_color_escape(set_background, idx, false); - } else { - return false; } + return false; } void write_color(rgb_color_t color, bool is_fg) { -- cgit v1.2.3