From f13e452f670f71c55f5ff50ac524f9ba592d23e7 Mon Sep 17 00:00:00 2001 From: moltenmuffins Date: Fri, 9 Oct 2020 10:20:45 +0800 Subject: [PATCH] Remove a possibly unecessary if/else --- rich/containers.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/rich/containers.py b/rich/containers.py index 4a8c26db..4ef865a2 100644 --- a/rich/containers.py +++ b/rich/containers.py @@ -153,11 +153,8 @@ class Lines: ): tokens.append(word) if index < len(spaces): - if next_word is None: - space_style = Style.null() - else: - style = word.get_style_at_offset(console, -1) - next_style = next_word.get_style_at_offset(console, 0) - space_style = style if style == next_style else line.style + style = word.get_style_at_offset(console, -1) + next_style = next_word.get_style_at_offset(console, 0) + space_style = style if style == next_style else line.style tokens.append(Text(" " * spaces[index], style=space_style)) self[line_index] = Text("").join(tokens)