From ffb37d6826ade8cbac862ef680df2e3b0df298e5 Mon Sep 17 00:00:00 2001 From: Zhisheng Huang Date: Tue, 16 Oct 2018 12:51:33 -0700 Subject: [PATCH] Add an assertion inside IGListAdapterUpdater to see if fromObjects contains duplicate identifiers Summary: Verify our assumption that the `fromObjects` should never contain duplicate identifiers. Reviewed By: calimarkus Differential Revision: D10410190 fbshipit-source-id: 4952698fee6373224b4c8395778009540c5ae380 --- Source/IGListAdapterUpdater.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/IGListAdapterUpdater.m b/Source/IGListAdapterUpdater.m index 37c2be79..6166ca2f 100644 --- a/Source/IGListAdapterUpdater.m +++ b/Source/IGListAdapterUpdater.m @@ -132,6 +132,8 @@ return; } + IGAssert(objectsWithDuplicateIdentifiersRemoved(fromObjects).count == fromObjects.count, @"The fromObjects has duplicate identifiers (it should already be dedupepd at this point)."); + NSArray *toObjects = nil; if (toObjectsBlock != nil) { toObjects = objectsWithDuplicateIdentifiersRemoved(toObjectsBlock());