Skip to content

Commit

Permalink
metadata performance tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
trehn committed Aug 22, 2017
1 parent 96310ab commit 2d985e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bundlewrap/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ def deepcopy_metadata(obj):
Our own version of deepcopy.copy that doesn't pickle and ensures
a limited range of types is used in metadata.
"""
if isinstance(obj, dict):
if isinstance(obj, METADATA_TYPES):
return obj
elif isinstance(obj, dict):
new_obj = {}
for key, value in obj.items():
if not isinstance(key, METADATA_TYPES):
Expand All @@ -169,8 +171,6 @@ def deepcopy_metadata(obj):
new_obj = set()
for member in obj:
new_obj.add(deepcopy_metadata(member))
elif isinstance(obj, METADATA_TYPES):
return obj
else:
raise ValueError(_("illegal metadata value type: {}").format(repr(obj)))
return new_obj
Expand Down

0 comments on commit 2d985e9

Please sign in to comment.