summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonah BrĂ¼chert <jbb@kaidan.im>2022-07-02 20:20:24 +0200
committerbadlop <badlop@gmail.com>2022-08-17 16:37:20 +0200
commit9a8a8437249792b8d230e36c4bf2855f5607cc9c (patch)
tree2eba3daf19bf9576bef410d1ba1b1b3e7946663d
parentParse sub elements of the mix join remote result (diff)
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.
-rw-r--r--src/mod_mix.erl6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mod_mix.erl b/src/mod_mix.erl
index 256715af..315c7b80 100644
--- a/src/mod_mix.erl
+++ b/src/mod_mix.erl
@@ -593,10 +593,8 @@ known_nodes() ->
-spec filter_nodes([binary()]) -> [binary()].
filter_nodes(Nodes) ->
- lists:filter(
- fun(Node) ->
- lists:member(Node, Nodes)
- end, known_nodes()).
+ KnownNodes = known_nodes(),
+ [Node || KnownNode <- KnownNodes, Node <- Nodes, KnownNode == Node].
-spec multicast(module(), binary(), binary(),
binary(), binary(), fun((jid()) -> message())) -> ok.