internal List <JsonPlusSubstitution> SetValue(JsonPlusValue value) { List <JsonPlusSubstitution> removedSubs = new List <JsonPlusSubstitution>(); if (value.Type == JsonPlusType.Array || value.Type == JsonPlusType.Literal) { List <JsonPlusSubstitution> subs = value.GetAllSubstitution(); if (subs.All(sub => sub.Path != Path)) { foreach (JsonPlusValue item in _internalValues) { removedSubs.AddRange(item.GetAllSubstitution()); } _internalValues.Clear(); } } _internalValues.Add(value); return(removedSubs); }