Skip to content

Commit

Permalink
Simplify logic in list commands bg_color() func
Browse files Browse the repository at this point in the history
This is an equivalent boolean statement making it easier to read.

<!-- ps-id: 41f6a1fa-4ce5-4446-b32e-369d695f9089 -->

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Drew De Ponte <cyphactor@gmail.com>
  • Loading branch information
Alizter authored and drewdeponte committed Jan 6, 2024
1 parent d00aea5 commit 3482d86
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/ps/public/list.rs
Expand Up @@ -68,14 +68,8 @@ fn bg_color(
) -> Option<ansi_term::Colour> {
let super_light_gray = Fixed(237);

if alternate_patch_series_bg_colors {
if (is_connected_to_prev_row && prev_row_showed_color)
|| (!is_connected_to_prev_row && !prev_row_showed_color)
{
Some(super_light_gray)
} else {
None
}
if alternate_patch_series_bg_colors && is_connected_to_prev_row == prev_row_showed_color {
Some(super_light_gray)
} else {
None
}
Expand Down

0 comments on commit 3482d86

Please sign in to comment.