Skip to content

Commit 9a8a843

Browse files
jbruechertbadlop
authored andcommitted
Fix filter_nodes
The previous implementation always returned an empty list while testing it. However I don't really understand why that happened. The list comprehension based one works, although it looks equivalent to me.
1 parent 0faf34b commit 9a8a843

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/mod_mix.erl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,10 +593,8 @@ known_nodes() ->
593593

594594
-spec filter_nodes([binary()]) -> [binary()].
595595
filter_nodes(Nodes) ->
596-
lists:filter(
597-
fun(Node) ->
598-
lists:member(Node, Nodes)
599-
end, known_nodes()).
596+
KnownNodes = known_nodes(),
597+
[Node || KnownNode <- KnownNodes, Node <- Nodes, KnownNode == Node].
600598

601599
-spec multicast(module(), binary(), binary(),
602600
binary(), binary(), fun((jid()) -> message())) -> ok.

0 commit comments

Comments
 (0)