         }
         _internalInvariant(enumeratedOriginals <= self.count)
       }
-      let origCount = self.count - enumeratedOriginals
-      try append(into: &result, contentsOf: self, from: &currentIndex, count: origCount)
-      _internalInvariant(enumeratedOriginals + origCount == self.count)
+      if currentIndex < self.endIndex {
+        result.append(contentsOf: self[currentIndex...])
+      }
+      _internalInvariant(result.count == self.count + enumeratedInserts - enumeratedRemoves)
     } catch {
       return nil
     }
 
-    _internalInvariant(currentIndex == self.endIndex)
-    _internalInvariant(result.count == self.count + enumeratedInserts - enumeratedRemoves)
     return result
   }
 }

      target.append(contentsOf: source[start..<index])
    }

    do {
      try difference._fastEnumeratedApply { change in
        switch change {
        case .remove(offset: let offset, element: _, associatedWith: _):

  ///   number of changes contained by the parameter.
  @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
  public func applying(_ difference: CollectionDifference<Element>) -> Self? {

    func append(
      into target: inout Self,
