internal void AddDiff(RenderTreeDiff diff) { var componentId = diff.ComponentId; if (!DiffsByComponentId.ContainsKey(componentId)) { DiffsByComponentId.Add(componentId, new List <CapturedRenderTreeDiff>()); } var renderTreeEdits = diff.Edits.ToArray(); var capturedTreeDiff = new CapturedRenderTreeDiff(diff.ComponentId, renderTreeEdits); DiffsByComponentId[componentId].Add(capturedTreeDiff); DiffsInOrder.Add(capturedTreeDiff); }
internal void AddDiff(RenderTreeDiff diff) { var componentId = diff.ComponentId; if (!DiffsByComponentId.ContainsKey(componentId)) { DiffsByComponentId.Add(componentId, new List <RenderTreeDiff>()); } // Clone the diff, because its underlying storage will get reused in subsequent batches var diffClone = new RenderTreeDiff( diff.ComponentId, new ArraySegment <RenderTreeEdit>(diff.Edits.ToArray())); DiffsByComponentId[componentId].Add(diffClone); DiffsInOrder.Add(diffClone); }