mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-24 12:22:27 +03:00
Remove redundant function calls to improve performance.
This commit is contained in:
parent
e4bcf3f00c
commit
00bcb72b8b
@ -266,44 +266,22 @@ map2 fn request1 request2 =
|
||||
Request
|
||||
( urls1
|
||||
, \appType rawResponses ->
|
||||
let
|
||||
value1 =
|
||||
lookupFn1 appType rawResponses
|
||||
|> Result.map Tuple.second
|
||||
|
||||
dict1 =
|
||||
lookupFn1 appType rawResponses
|
||||
|> Result.map Tuple.first
|
||||
|> Result.withDefault Dict.empty
|
||||
in
|
||||
Result.map2
|
||||
(\thing1 thing2 ->
|
||||
( dict1, map2 fn thing1 thing2 )
|
||||
|> Result.map
|
||||
(\( dict1, value1 ) ->
|
||||
( dict1, map2 fn value1 (Done value2) )
|
||||
)
|
||||
value1
|
||||
(Ok (Done value2))
|
||||
)
|
||||
|
||||
( Done value2, Request ( urls1, lookupFn1 ) ) ->
|
||||
Request
|
||||
( urls1
|
||||
, \appType rawResponses ->
|
||||
let
|
||||
value1 =
|
||||
lookupFn1 appType rawResponses
|
||||
|> Result.map Tuple.second
|
||||
|
||||
dict1 =
|
||||
lookupFn1 appType rawResponses
|
||||
|> Result.map Tuple.first
|
||||
|> Result.withDefault Dict.empty
|
||||
in
|
||||
Result.map2
|
||||
(\thing1 thing2 ->
|
||||
( dict1, map2 fn thing1 thing2 )
|
||||
|> Result.map
|
||||
(\( dict1, value1 ) ->
|
||||
( dict1, map2 fn (Done value2) value1 )
|
||||
)
|
||||
(Ok (Done value2))
|
||||
value1
|
||||
)
|
||||
|
||||
( Done value1, Done value2 ) ->
|
||||
|
Loading…
Reference in New Issue
Block a user