mirror of https://github.com/Textualize/rich.git
simple optimization
This commit is contained in:
parent
ee8a0b56c5
commit
eb6c74b5c8
|
@ -228,10 +228,10 @@ class Text(JupyterMixin):
|
||||||
@property
|
@property
|
||||||
def plain(self) -> str:
|
def plain(self) -> str:
|
||||||
"""Get the text as a single string."""
|
"""Get the text as a single string."""
|
||||||
if len(self._text) not in (0, 1):
|
if len(self._text) != 1:
|
||||||
text = "".join(self._text)
|
text = "".join(self._text)
|
||||||
self._text[:] = [text]
|
self._text[:] = [text]
|
||||||
return self._text[0] if self._text else ""
|
return self._text[0]
|
||||||
|
|
||||||
@plain.setter
|
@plain.setter
|
||||||
def plain(self, new_text: str) -> None:
|
def plain(self, new_text: str) -> None:
|
||||||
|
|
Loading…
Reference in New Issue