Skip to content

Commit

Permalink
Use list comprehension to build the url_and_hash_list
Browse files Browse the repository at this point in the history
  • Loading branch information
ashfall committed Dec 3, 2016
1 parent fe03620 commit 3ede2d6
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions tls/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,15 @@ def from_bytes(cls, bytes):
:return: CertificateURL object.
"""
construct = _constructs.CertificateURL.parse(bytes)
url_and_hash_list = []
for url_and_hash in construct.url_and_hash_list:
url_and_hash_list.append(URLAndHash(
url=url_and_hash.url,
padding=url_and_hash.padding,
sha1_hash=url_and_hash.sha1_hash,
))

return cls(
type=construct.type,
url_and_hash_list=url_and_hash_list,
url_and_hash_list=[
URLAndHash(
url=url_and_hash.url,
padding=url_and_hash.padding,
sha1_hash=url_and_hash.sha1_hash,
)
for url_and_hash in construct.url_and_hash_list],
)


Expand Down

0 comments on commit 3ede2d6

Please sign in to comment.