anchor.diff:      case is_current_slot(Time, CurrentTime, SlotLength) of
           true ->
               CurrentIndex = DB#rrd.current_index,
  -            update_with(DB, CurrentIndex, Time, Value, F);
  +            Data = DB#rrd.data,
  +            case array:get(CurrentIndex, Data) of
  +                undefined ->
  +                    DB#rrd{data = array:set(CurrentIndex, F(Time, undefined, Value), Data)};
  +                OldValue ->
  +                    DB#rrd{data = array:set(CurrentIndex, F(Time, OldValue, Value), Data)}
  +            end;
           _ ->
               case is_future_slot(Time, CurrentTime, SlotLength) of
                   true ->
                       Count = DB#rrd.count,
                       CurrentIndex = DB#rrd.current_index,
  +                    Data = DB#rrd.data,
                       FillPolicy = DB#rrd.fill_policy,
                       Delta = (Time - CurrentTime) div SlotLength,
  -                            NewIndex = (CurrentIndex + Delta) rem Count,
  +                    NewIndex = (CurrentIndex + Delta) rem Count,
                       FilledData =
                           case Delta > Count of
                               true when FillPolicy =:= set_undefined ->
  
positive.code:                                 array:new(Count);
                              true ->
                                  % fill everything:
                                  fill(DB#rrd.data, FillPolicy, Count,
                                       (CurrentIndex + 1) rem Count,
                                       CurrentIndex,
                                       array:get(CurrentIndex, DB#rrd.data));
                              _ ->
                                  fill(DB#rrd.data, FillPolicy, Count,
                                       (CurrentIndex + 1) rem Count,
                                       NewIndex,
                                       array:get(CurrentIndex, DB#rrd.data))
                          end,
                      DB#rrd{data = array:set(NewIndex, F(Time, undefined, Value), FilledData),
                             current_index = NewIndex,
  
negative.code:                 _ -> % PastTimeSlot; ignore
                      DB
              end
      end.
  
  -spec fill(array(), fill_policy_type(), pos_integer(), non_neg_integer(), non_neg_integer(), data_type() | undefined) -> array().
  