     override func viewDidLayoutSubviews() {
         super.viewDidLayoutSubviews()
         
-        if updateWidthsOnLayoutSubviews {
-            backgroundUpdateListViewModels(listViewModel: dataSource, updateType: .widthChangedUpdate(width: collectionView.frame.width)) {
-                //self.collectionView.collectionViewLayout.invalidateLayout()
-                self.applyListViewModelChanges(updateType: .widthChangedUpdate(width: self.collectionView.frame.width))
-                self.updateWidthsOnLayoutSubviews = false
-            }
-        }
+//        if updateWidthsOnLayoutSubviews {
+//            backgroundUpdateListViewModels(listViewModel: dataSource, updateType: .widthChangedUpdate(width: collectionView.frame.width)) {
+//                self.applyListViewModelChanges(updateType: .widthChangedUpdate(width: self.collectionView.frame.width))
+//                self.updateWidthsOnLayoutSubviews = false
+//            }
+//        }
+    }
+    
+    override func didReceiveMemoryWarning() {
+        super.didReceiveMemoryWarning()
+        
+        cachedSizes.removeAll()
     }
     
     override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
         super.viewWillTransition(to: size, with: coordinator)
         
-        updateWidthsOnLayoutSubviews = true
-        coordinator.animate(alongsideTransition: { (context) in
-            //nothing
-        }) { (context) in
-            self.updateWidthsOnLayoutSubviews = false
-        }
-        
-//        backgroundUpdateListViewModels(listViewModel: dataSource, updateType: .widthChangedUpdate(width: size.width)) {
-//            self.applyListViewModelChanges(updateType: .widthChangedUpdate(width: size.width))
+        backgroundUpdateListViewModels(listViewModel: dataSource, updateType: .widthChangedUpdate(width: size.width)) {
+            self.applyListViewModelChanges(updateType: .widthChangedUpdate(width: size.width))
+        }
+        
+//        updateWidthsOnLayoutSubviews = true
+//        //updateListViewModels(listViewModel: dataSource, updateType: .widthChangedUpdate(width: size.width))
+//        coordinator.animate(alongsideTransition: { (context) in
+//            //self.applyListViewModelChanges(updateType: .widthChangedUpdate(width: size.width))
+//        }) { (context) in
+//            self.updateWidthsOnLayoutSubviews = false
 //        }
-    }
-    
-    override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) {
-        super.willTransition(to: newCollection, with: coordinator)
-        
-        //updateListViewModels(listViewModel: dataSource, updateType: .fontOrMarginUpdate(traitCollection: traitCollection))
-        //applyListViewModelChanges(updateType: .fontOrMarginUpdate(traitCollection: traitCollection))
     }
     
     override func scrollViewDidScroll(_ scrollView: UIScrollView) {

    private var dataSource: [DiffListGroupViewModel] = []
    private weak var delegate: DiffListDelegate?
    private var updateWidthsOnLayoutSubviews = false
    
    init(theme: Theme, delegate: DiffListDelegate?) {
        super.init(nibName: nil, bundle: nil)

        
        if let contextViewModel = viewModel as? DiffListContextViewModel {
            let height = contextViewModel.isExpanded ? contextViewModel.expandedHeight : contextViewModel.height
            return CGSize(width: min(collectionView.frame.width, contextViewModel.width), height: height)
        }
        
        return CGSize(width: min(collectionView.frame.width, viewModel.width), height: viewModel.height)

    }
    
