Skip to content

Commit

Permalink
perf(Cookies): 使用字典推导式优化Cookies生成
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip authored Sep 5, 2019
1 parent e776a9c commit 769df98
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions utils/cookie.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,4 @@ def cookies_raw2jar(raw: str) -> dict:
raise ValueError("The Cookies is not allowed to be empty.")

cookie = SimpleCookie(raw)
cookies = {}
for key, morsel in cookie.items():
cookies[key] = morsel.value
return cookies
return {key: morsel.value for key, morsel in cookie.items()}

0 comments on commit 769df98

Please sign in to comment.