Skip to content

Commit

Permalink
Replace empty dict literal with built-in dict function
Browse files Browse the repository at this point in the history
Description: Performance optimization. Replacing the dict() calls with direct {} statements
  • Loading branch information
ShahriyarR committed May 13, 2022
1 parent 2252837 commit 3a91387
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fastapi/utils.py
Expand Up @@ -76,7 +76,7 @@ def create_cloned_field(
) -> ModelField:
# _cloned_types has already cloned types, to support recursive models
if cloned_types is None:
cloned_types = dict()
cloned_types = {}
original_type = field.type_
if is_dataclass(original_type) and hasattr(original_type, "__pydantic_model__"):
original_type = original_type.__pydantic_model__
Expand Down

0 comments on commit 3a91387

Please sign in to comment.