From b6541e6418fe7207bd86b701022b9989cabae691 Mon Sep 17 00:00:00 2001 From: Shubham Patel <165564832+shubham0x13@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:25:12 +0530 Subject: [PATCH] Optimize LabelBase text setter --- adafruit_display_text/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/adafruit_display_text/__init__.py b/adafruit_display_text/__init__.py index 2ae8ca2..e154a54 100755 --- a/adafruit_display_text/__init__.py +++ b/adafruit_display_text/__init__.py @@ -413,6 +413,8 @@ def text(self) -> str: @text.setter # Cannot set color or background color with text setter, use separate setter def text(self, new_text: str) -> None: + if new_text == self._text: + return self._set_text(new_text, self.scale) @property