Skip to content

Commit

Permalink
Using list comprehension.
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Aug 6, 2018
1 parent c2fa096 commit 03f5fa8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/Network/TLS/Extension.hs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ data KeyShare =
instance Extension KeyShare where
extensionID _ = extensionID_KeyShare
extensionEncode (KeyShareClientHello kses) = runPut $ do
let !len = sum $ map (\(KeyShareEntry _ key) -> B.length key + 4) kses
let !len = sum [B.length key + 4 | KeyShareEntry _ key <- kses]
putWord16 $ fromIntegral len
mapM_ putKeyShareEntry kses
extensionEncode (KeyShareServerHello kse) = runPut $ putKeyShareEntry kse
Expand Down

0 comments on commit 03f5fa8

Please sign in to comment.