summaryrefslogtreecommitdiff
path: root/lib/stdlib
diff options
context:
space:
mode:
authorMaria Scott <maria-12648430@hnc-agency.org>2023-03-06 18:37:02 +0100
committerMaria Scott <maria-12648430@hnc-agency.org>2023-03-06 18:37:02 +0100
commit6f6224face0ed6e6c2a6e6af715006eb13497a0e (patch)
tree8fb22a51ee32f4ad34bebe8a1482a8013dce04e3 /lib/stdlib
parentb07e0d167027432a83dc61c85305de5fcdada997 (diff)
downloaderlang-6f6224face0ed6e6c2a6e6af715006eb13497a0e.tar.gz
gen_statem: list comprehension with map generator instead of maps:fold
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/src/gen_statem.erl9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/stdlib/src/gen_statem.erl b/lib/stdlib/src/gen_statem.erl
index ff808ef458..b30337e7d8 100644
--- a/lib/stdlib/src/gen_statem.erl
+++ b/lib/stdlib/src/gen_statem.erl
@@ -3081,9 +3081,6 @@ cancel_timer(TimeoutType, Timers) ->
%% Return a list of all pending timeouts
list_timeouts(Timers) ->
{maps:size(Timers) - 1, % Subtract fixed key 't0q'
- maps:fold(
- fun (t0q, _, Acc) ->
- Acc;
- (TimeoutType, {_TimerRef,TimeoutMsg}, Acc) ->
- [{TimeoutType,TimeoutMsg}|Acc]
- end, [], Timers)}.
+ [{TimeoutType, TimeoutMsg}
+ || TimeoutType := {_TimerRef, TimeoutMsg} <- Timers,
+ TimeoutType =/= t0q]}.