Skip to content

Commit

Permalink
Refactor attribute filtering in PlexObject class (#1341)
Browse files Browse the repository at this point in the history
* Refactor attribute filtering in PlexObject class

- minor performance imporvement

* Update plexapi/base.py

Co-authored-by: JonnyWong16 <[email protected]>

---------

Co-authored-by: JonnyWong16 <[email protected]>
  • Loading branch information
Dr-Blank and JonnyWong16 authored Feb 17, 2024
1 parent 9d9dca8 commit 41f6b9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plexapi/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41f6b9c

Please sign in to comment.