@@ -251,7 +251,7 @@ ShadowViewNodePair::List sliceChildShadowNodeViewPairsV2(
251
251
reorderInPlaceIfNeeded (pairList);
252
252
253
253
// Set list and mountIndex for each after reordering
254
- int mountIndex = 0 ;
254
+ size_t mountIndex = 0 ;
255
255
for (auto &child : pairList) {
256
256
child.mountIndex = (child.isConcreteView ? mountIndex++ : -1 );
257
257
}
@@ -376,7 +376,7 @@ static void calculateShadowViewMutationsFlattener(
376
376
<< " [" << node.shadowView .tag << " ]" ;
377
377
LOG (ERROR) << " Differ Flattener Entry: Child Pairs: " ;
378
378
std::string strTreeChildPairs;
379
- for (int k = 0 ; k < treeChildren.size (); k++) {
379
+ for (size_t k = 0 ; k < treeChildren.size (); k++) {
380
380
strTreeChildPairs.append (std::to_string (treeChildren[k].shadowView .tag ));
381
381
strTreeChildPairs.append (treeChildren[k].isConcreteView ? " " : " '" );
382
382
strTreeChildPairs.append (treeChildren[k].flattened ? " *" : " " );
@@ -410,7 +410,7 @@ static void calculateShadowViewMutationsFlattener(
410
410
auto deletionCreationCandidatePairs =
411
411
TinyMap<Tag, ShadowViewNodePair const *>{};
412
412
413
- for (int index = 0 ;
413
+ for (size_t index = 0 ;
414
414
index < treeChildren.size () && index < treeChildren.size ();
415
415
index ++) {
416
416
// First, remove all children of the tree being flattened, or insert
@@ -530,7 +530,7 @@ static void calculateShadowViewMutationsFlattener(
530
530
// this "else" block, including any annotations we put on them.
531
531
auto newFlattenedNodes = sliceChildShadowNodeViewPairsV2 (
532
532
*newTreeNodePair.shadowNode , true );
533
- for (int i = 0 ; i < newFlattenedNodes.size (); i++) {
533
+ for (size_t i = 0 ; i < newFlattenedNodes.size (); i++) {
534
534
auto &newChild = newFlattenedNodes[i];
535
535
536
536
auto unvisitedOtherNodesIt =
@@ -582,7 +582,7 @@ static void calculateShadowViewMutationsFlattener(
582
582
// this "else" block, including any annotations we put on them.
583
583
auto oldFlattenedNodes = sliceChildShadowNodeViewPairsV2 (
584
584
*oldTreeNodePair.shadowNode , true );
585
- for (int i = 0 ; i < oldFlattenedNodes.size (); i++) {
585
+ for (size_t i = 0 ; i < oldFlattenedNodes.size (); i++) {
586
586
auto &oldChild = oldFlattenedNodes[i];
587
587
588
588
auto unvisitedOtherNodesIt =
@@ -767,7 +767,7 @@ static void calculateShadowViewMutationsV2(
767
767
return ;
768
768
}
769
769
770
- auto index = int { 0 } ;
770
+ size_t index = 0 ;
771
771
772
772
// Lists of mutations
773
773
auto createMutations = ShadowViewMutation::List{};
@@ -790,7 +790,7 @@ static void calculateShadowViewMutationsV2(
790
790
LOG (ERROR) << " Differ Entry: Child Pairs of node: [" << parentShadowView.tag
791
791
<< " ]" ;
792
792
std::string strOldChildPairs;
793
- for (int oldIndex = 0 ; oldIndex < oldChildPairs.size (); oldIndex++) {
793
+ for (size_t oldIndex = 0 ; oldIndex < oldChildPairs.size (); oldIndex++) {
794
794
strOldChildPairs.append (
795
795
std::to_string (oldChildPairs[oldIndex].shadowView .tag ));
796
796
strOldChildPairs.append (
@@ -799,7 +799,7 @@ static void calculateShadowViewMutationsV2(
799
799
strOldChildPairs.append (" , " );
800
800
}
801
801
std::string strNewChildPairs;
802
- for (int newIndex = 0 ; newIndex < newChildPairs.size (); newIndex++) {
802
+ for (size_t newIndex = 0 ; newIndex < newChildPairs.size (); newIndex++) {
803
803
strNewChildPairs.append (
804
804
std::to_string (newChildPairs[newIndex].shadowView .tag ));
805
805
strNewChildPairs.append (
@@ -872,7 +872,7 @@ static void calculateShadowViewMutationsV2(
872
872
}
873
873
}
874
874
875
- int lastIndexAfterFirstStage = index ;
875
+ size_t lastIndexAfterFirstStage = index ;
876
876
877
877
if (index == newChildPairs.size ()) {
878
878
// We've reached the end of the new children. We can delete+remove the
@@ -943,9 +943,9 @@ static void calculateShadowViewMutationsV2(
943
943
// Walk through both lists at the same time
944
944
// We will perform updates, create+insert, remove+delete, remove+insert
945
945
// (move) here.
946
- int oldIndex = lastIndexAfterFirstStage,
947
- newIndex = lastIndexAfterFirstStage, newSize = newChildPairs.size (),
948
- oldSize = oldChildPairs.size ();
946
+ size_t oldIndex = lastIndexAfterFirstStage,
947
+ newIndex = lastIndexAfterFirstStage, newSize = newChildPairs.size (),
948
+ oldSize = oldChildPairs.size ();
949
949
while (newIndex < newSize || oldIndex < oldSize) {
950
950
bool haveNewPair = newIndex < newSize;
951
951
bool haveOldPair = oldIndex < oldSize;
@@ -955,8 +955,8 @@ static void calculateShadowViewMutationsV2(
955
955
auto const &oldChildPair = oldChildPairs[oldIndex];
956
956
auto const &newChildPair = newChildPairs[newIndex];
957
957
958
- int newTag = newChildPair.shadowView .tag ;
959
- int oldTag = oldChildPair.shadowView .tag ;
958
+ Tag newTag = newChildPair.shadowView .tag ;
959
+ Tag oldTag = oldChildPair.shadowView .tag ;
960
960
961
961
if (newTag == oldTag) {
962
962
DEBUG_LOGS ({
@@ -1050,7 +1050,7 @@ static void calculateShadowViewMutationsV2(
1050
1050
// children from other nodes, etc.
1051
1051
auto oldFlattenedNodes = sliceChildShadowNodeViewPairsV2 (
1052
1052
*oldChildPair.shadowNode , true );
1053
- for (int i = 0 , j = 0 ;
1053
+ for (size_t i = 0 , j = 0 ;
1054
1054
i < oldChildPairs.size () && j < oldFlattenedNodes.size ();
1055
1055
i++) {
1056
1056
auto &oldChild = oldChildPairs[i];
@@ -1119,7 +1119,7 @@ static void calculateShadowViewMutationsV2(
1119
1119
if (haveOldPair) {
1120
1120
auto const &oldChildPair = oldChildPairs[oldIndex];
1121
1121
1122
- int oldTag = oldChildPair.shadowView .tag ;
1122
+ Tag oldTag = oldChildPair.shadowView .tag ;
1123
1123
1124
1124
// Was oldTag already inserted? This indicates a reordering, not just
1125
1125
// a move. The new node has already been inserted, we just need to
@@ -1171,7 +1171,7 @@ static void calculateShadowViewMutationsV2(
1171
1171
// children from other nodes, etc.
1172
1172
auto oldFlattenedNodes = sliceChildShadowNodeViewPairsV2 (
1173
1173
*oldChildPair.shadowNode , true );
1174
- for (int i = 0 , j = 0 ;
1174
+ for (size_t i = 0 , j = 0 ;
1175
1175
i < oldChildPairs.size () && j < oldFlattenedNodes.size ();
1176
1176
i++) {
1177
1177
auto &oldChild = oldChildPairs[i];
@@ -1565,7 +1565,7 @@ static void calculateShadowViewMutations(
1565
1565
std::move (newGrandChildPairs));
1566
1566
}
1567
1567
1568
- int lastIndexAfterFirstStage = index ;
1568
+ size_t lastIndexAfterFirstStage = index ;
1569
1569
1570
1570
if (index == newChildPairs.size ()) {
1571
1571
// We've reached the end of the new children. We can delete+remove the
@@ -1630,9 +1630,9 @@ static void calculateShadowViewMutations(
1630
1630
// Walk through both lists at the same time
1631
1631
// We will perform updates, create+insert, remove+delete, remove+insert
1632
1632
// (move) here.
1633
- int oldIndex = lastIndexAfterFirstStage,
1634
- newIndex = lastIndexAfterFirstStage, newSize = newChildPairs.size (),
1635
- oldSize = oldChildPairs.size ();
1633
+ size_t oldIndex = lastIndexAfterFirstStage,
1634
+ newIndex = lastIndexAfterFirstStage, newSize = newChildPairs.size (),
1635
+ oldSize = oldChildPairs.size ();
1636
1636
while (newIndex < newSize || oldIndex < oldSize) {
1637
1637
bool haveNewPair = newIndex < newSize;
1638
1638
bool haveOldPair = oldIndex < oldSize;
@@ -1642,8 +1642,8 @@ static void calculateShadowViewMutations(
1642
1642
auto const &newChildPair = newChildPairs[newIndex];
1643
1643
auto const &oldChildPair = oldChildPairs[oldIndex];
1644
1644
1645
- int newTag = newChildPair.shadowView .tag ;
1646
- int oldTag = oldChildPair.shadowView .tag ;
1645
+ Tag newTag = newChildPair.shadowView .tag ;
1646
+ Tag oldTag = oldChildPair.shadowView .tag ;
1647
1647
1648
1648
if (newTag == oldTag) {
1649
1649
DEBUG_LOGS ({
@@ -1690,7 +1690,7 @@ static void calculateShadowViewMutations(
1690
1690
1691
1691
if (haveOldPair) {
1692
1692
auto const &oldChildPair = oldChildPairs[oldIndex];
1693
- int oldTag = oldChildPair.shadowView .tag ;
1693
+ Tag oldTag = oldChildPair.shadowView .tag ;
1694
1694
1695
1695
// Was oldTag already inserted? This indicates a reordering, not just
1696
1696
// a move. The new node has already been inserted, we just need to
0 commit comments