anchor.diff:  	    end
       end.
   
  -is_dynamic_pid(Pid, Dynamics) ->
  -    case ?SETS:is_set(Dynamics) of
  -	true ->
  -	    ?SETS:is_element(Pid, Dynamics);
  -	false ->
  -	    ?DICTS:is_key(Pid, Dynamics)
  -    end.
  +is_dynamic_pid(Pid, {dict, Dynamics}) ->
  +    ?DICTS:is_key(Pid, Dynamics);
  +is_dynamic_pid(Pid, {set, Dynamics}) ->
  +    ?SETS:is_element(Pid, Dynamics);
  +is_dynamic_pid(_Pid, undefined) ->
  +    false.
   
   replace_child(Child, State) ->
       Chs = do_replace_child(Child, State#state.children),
  
positive.code:   when ?is_simple(State) ->
      RT = Child#child.restart_type,
      RPid = restarting(Pid),
      case dynamic_child_args(RPid, dynamics_db(RT, State#state.dynamics)) of
  	{ok, Args} ->
  	    {M, F, _} = Child#child.mfargs,
  	    NChild = Child#child{pid = RPid, mfargs = {M, F, Args}},
  
negative.code:     State#state{children = [Child |Children]}.
  
  save_dynamic_child(temporary, Pid, _, #state{dynamics = Dynamics} = State) ->
      DynamicsDb = dynamics_db(temporary, Dynamics),
      State#state{dynamics = {set, ?SETS:add_element(Pid, DynamicsDb)}};
  save_dynamic_child(RestartType, Pid, Args, #state{dynamics = Dynamics} = State) ->
      DynamicsDb = dynamics_db(RestartType, Dynamics),
      State#state{dynamics = {dict, ?DICTS:store(Pid, Args, DynamicsDb)}}.
  
  dynamics_db(temporary, undefined) ->
      ?SETS:new();
  dynamics_db(_, undefined) ->
      ?DICTS:new();
  dynamics_db(_, {_Tag, DynamicsDb}) ->
      DynamicsDb.
  
  dynamic_child_args(_Pid, temporary, _DynamicsDb) ->
      {ok, undefined};
  dynamic_child_args(Pid, _RT, {dict, DynamicsDb}) ->
      ?DICTS:find(Pid, DynamicsDb);
  dynamic_child_args(_Pid, _RT, undefined) ->
      error.
  
  state_del_child(#child{pid = Pid, restart_type = temporary}, State) when ?is_simple(State) ->
      NDynamics = ?SETS:del_element(Pid, dynamics_db(temporary, State#state.dynamics)),
      State#state{dynamics = {set, NDynamics}};
  state_del_child(#child{pid = Pid, restart_type = RType}, State) when ?is_simple(State) ->
      NDynamics = ?DICTS:erase(Pid, dynamics_db(RType, State#state.dynamics)),
      State#state{dynamics = {dict, NDynamics}};
  state_del_child(Child, State) ->
      NChildren = del_child(Child#child.name, State#state.children),
      State#state{children = NChildren}.
  