Avoid a copy when custom function is not used

This commit is contained in:
Kovid Goyal 2025-08-30 09:03:34 +05:30
parent 1544830307
commit ab4e86dfec
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -526,7 +526,7 @@ class CustomDrawTitleFunc:
def __init__(self, data: dict[str, Any], implementation: Callable[[dict[str, Any]], str] | None = None):
self._implementation = implementation
self._data = data.copy()
self._data = {} if implementation is None else data.copy()
def __str__(self) -> str:
if self._implementation is None: