From 41f6b9cf93c24032cb313b5b0203c8b7ae9f06c7 Mon Sep 17 00:00:00 2001 From: "Dr.Blank" <64108942+Dr-Blank@users.noreply.github.com> Date: Sat, 17 Feb 2024 17:16:21 -0500 Subject: [PATCH] Refactor attribute filtering in PlexObject class (#1341) * Refactor attribute filtering in PlexObject class - minor performance imporvement * Update plexapi/base.py Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> --------- Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> --- plexapi/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexapi/base.py b/plexapi/base.py index f6aaba53e..e6ab80907 100644 --- a/plexapi/base.py +++ b/plexapi/base.py @@ -440,7 +440,7 @@ def _getAttrValue(self, elem, attrstr, results=None): attrstr = parts[1] if len(parts) == 2 else None if attrstr: results = [] if results is None else results - for child in [c for c in elem if c.tag.lower() == attr.lower()]: + for child in (c for c in elem if c.tag.lower() == attr.lower()): results += self._getAttrValue(child, attrstr, results) return [r for r in results if r is not None] # check were looking for the tag