From cf6c9a86b79f1c70befdd86b0616b2a6044effb6 Mon Sep 17 00:00:00 2001 From: moklick Date: Thu, 11 Jan 2024 11:08:32 +0100 Subject: [PATCH] refactor(react/changes): cleanup --- packages/react/src/utils/changes.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/react/src/utils/changes.ts b/packages/react/src/utils/changes.ts index 9f2df299..87b87c3a 100644 --- a/packages/react/src/utils/changes.ts +++ b/packages/react/src/utils/changes.ts @@ -73,12 +73,7 @@ function applyChanges(changes: any[], elements: any[]): any[] { changesMap.set(change.id, [change]); } else { const elementChanges = changesMap.get(change.id); - // If we already have a 'remove' change queued for this element, we don't - // need to bother queueing any other changes for it, - // - // We might end up needlessly iterating over this changes array but in - // practice it will be very small (e.g. less than 5 or so items). - if (elementChanges?.some((c) => c.type === 'remove')) continue; + if (elementChanges) { // If we have some changes queued already, we can do a mutable update of // that array and save ourselves some copying.