Skip to content
Permalink
Browse files
Reduce one traversal by --
  • Loading branch information
dengzhongwen committed Jun 29, 2018
1 parent e0c3614 commit 6d19dfcb7670ed3620c7b7f2452373dd2603e21e
Showing 1 changed file with 5 additions and 2 deletions.
@@ -77,8 +77,11 @@ port_list(Attr, Val) ->
%% all processes of the node, except the caller.
-spec proc_attrs(term()) -> [recon:proc_attrs()].
proc_attrs(AttrName) ->
[Attrs || Pid <- processes() -- [self()],
{ok, Attrs} <- [proc_attrs(AttrName, Pid)]].
Self = self(),
[Attrs || Pid <- processes(),
Pid =/= Self,
{ok, Attrs} <- [proc_attrs(AttrName, Pid)]
].

%% @doc Returns the attributes of a given process. This form of attributes
%% is standard for most comparison functions for processes in recon.

0 comments on commit 6d19dfc

Please sign in to comment.