micro optimization

This commit is contained in:
Kovid Goyal 2024-09-13 20:45:15 +05:30
parent 6f00feb3cb
commit 492db4c2e8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -514,7 +514,7 @@ class Metadata:
''' '''
def copy_not_none(dest, src, attr): def copy_not_none(dest, src, attr):
v = getattr(src, attr, None) v = getattr(src, attr, None)
if v not in (None, NULL_VALUES.get(attr, None)): if v is not None and v != NULL_VALUES.get(attr, None):
setattr(dest, attr, copy.deepcopy(v)) setattr(dest, attr, copy.deepcopy(v))
unknown = _('Unknown') unknown = _('Unknown')