Thanks to visit codestin.com
Credit goes to github.com

Skip to content

♻ Refactor dict value extraction to minimize key lookups fastapi/utils.py#3139

Merged
tiangolo merged 2 commits into
fastapi:masterfrom
ShahriyarR:unpack-value-from-update-dict
May 12, 2022
Merged

♻ Refactor dict value extraction to minimize key lookups fastapi/utils.py#3139
tiangolo merged 2 commits into
fastapi:masterfrom
ShahriyarR:unpack-value-from-update-dict

Conversation

@ShahriyarR

Copy link
Copy Markdown
Contributor

There are 3 extra key/value lookups for update_dict, it can be eliminated by unpacking value in for loop directly.

@codecov

codecov Bot commented May 1, 2021

Copy link
Copy Markdown

Codecov Report

Merging #3139 (6662091) into master (497e5a2) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #3139   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          531       531           
  Lines        13629     13629           
=========================================
  Hits         13629     13629           
Impacted Files Coverage Δ
fastapi/utils.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 497e5a2...6662091. Read the comment docs.

@github-actions

github-actions Bot commented May 1, 2021

Copy link
Copy Markdown
Contributor

📝 Docs preview for commit 32df705 at: https://608d277e521eb71b0f16ecd0--fastapi.netlify.app

@tiangolo tiangolo changed the title unpack the value using .items() to eliminate 3 extra key lookup ♻ Refactor dict value extraction to minimize key lookups fastapi/utils.py May 12, 2022
@tiangolo tiangolo enabled auto-merge (squash) May 12, 2022 20:37
@tiangolo

Copy link
Copy Markdown
Member

Nice, thank you! 😎🚀

@tiangolo tiangolo merged commit 82775f7 into fastapi:master May 12, 2022
JeanArhancet pushed a commit to JeanArhancet/fastapi that referenced this pull request Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants