@@ -16,8 +16,7 @@ defmodule Membrane.Core.Parent.ChildLifeController.CrashGroupUtils do
16
16
def add_crash_group ( group_name , mode , children , state )
17
17
when not is_map_key ( state . crash_groups , group_name ) do
18
18
put_in (
19
- state ,
20
- [ :crash_groups , group_name ] ,
19
+ state . crash_groups [ group_name ] ,
21
20
% CrashGroup {
22
21
name: group_name ,
23
22
mode: mode ,
@@ -28,7 +27,7 @@ defmodule Membrane.Core.Parent.ChildLifeController.CrashGroupUtils do
28
27
29
28
@ spec extend_crash_group ( Child . group ( ) , [ Child . name ( ) ] , Parent . state ( ) ) :: Parent . state ( )
30
29
def extend_crash_group ( group_name , children , state ) do
31
- update_in ( state , [ : crash_groups, group_name , :members ] , & ( children ++ & 1 ) )
30
+ update_in ( state . crash_groups [ group_name ] . members , & ( children ++ & 1 ) )
32
31
end
33
32
34
33
@ spec get_child_crash_group ( Child . name ( ) , Parent . state ( ) ) :: { :ok , CrashGroup . t ( ) } | :error
@@ -44,7 +43,7 @@ defmodule Membrane.Core.Parent.ChildLifeController.CrashGroupUtils do
44
43
# and we will not want to have it in :crash_group_members in the callback context in handle_crash_group_down/3,
45
44
# so this child is removed from :members in crash group struct
46
45
members = List . delete ( group . members , child_name )
47
- state = put_in ( state , [ : crash_groups, group . name , :members ] , members )
46
+ state = put_in ( state . crash_groups [ group . name ] . members , members )
48
47
49
48
if group . detonating? and Enum . all? ( members , & ( not Map . has_key? ( state . children , & 1 ) ) ) do
50
49
cleanup_crash_group ( group . name , state )
@@ -83,8 +82,7 @@ defmodule Membrane.Core.Parent.ChildLifeController.CrashGroupUtils do
83
82
end )
84
83
85
84
update_in (
86
- state ,
87
- [ :crash_groups , group . name ] ,
85
+ state . crash_groups [ group . name ] ,
88
86
& % CrashGroup {
89
87
& 1
90
88
| detonating?: true ,
@@ -96,15 +94,15 @@ defmodule Membrane.Core.Parent.ChildLifeController.CrashGroupUtils do
96
94
97
95
defp cleanup_crash_group ( group_name , state ) do
98
96
state = exec_handle_crash_group_down ( group_name , state )
99
- { _group , state } = pop_in ( state , [ : crash_groups, group_name ] )
97
+ { _group , state } = pop_in ( state . crash_groups [ group_name ] )
100
98
state
101
99
end
102
100
103
101
defp exec_handle_crash_group_down (
104
102
group_name ,
105
103
state
106
104
) do
107
- crash_group = get_in ( state , [ : crash_groups, group_name ] )
105
+ crash_group = state . crash_groups [ group_name ]
108
106
109
107
context_generator =
110
108
& Component . context_from_state ( & 1 ,
0 commit comments