Skip to content

Commit aedb50a

Browse files
committed
Slight improvement to MultiSearch.length
1 parent b2eb5f3 commit aedb50a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Lib/MultiSearch.elm

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,16 @@ length s =
304304
Nothing
305305

306306
Searching s_ ->
307+
let
308+
sum list acc =
309+
list
310+
|> RemoteData.map List.length
311+
|> RemoteData.withDefault 0
312+
|> (+) acc
313+
in
307314
s_.requests
308-
|> Dict.toList
309-
|> List.map (Tuple.second >> RemoteData.map List.length >> RemoteData.withDefault 0)
310-
|> List.sum
315+
|> Dict.values
316+
|> List.foldl sum 0
311317
|> Just
312318

313319
Success _ r ->

0 commit comments

Comments
 (0)