From eb6c74b5c8ad4ebbb4e7facd0f24bef5f87f50fe Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sun, 7 Jun 2020 10:46:36 +0100 Subject: [PATCH] simple optimization --- rich/text.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rich/text.py b/rich/text.py index f9cfcc3c..631f9859 100644 --- a/rich/text.py +++ b/rich/text.py @@ -228,10 +228,10 @@ class Text(JupyterMixin): @property def plain(self) -> str: """Get the text as a single string.""" - if len(self._text) not in (0, 1): + if len(self._text) != 1: text = "".join(self._text) self._text[:] = [text] - return self._text[0] if self._text else "" + return self._text[0] @plain.setter def plain(self, new_text: str) -> None: