Skip to content
This repository was archived by the owner on Dec 5, 2022. It is now read-only.
This repository was archived by the owner on Dec 5, 2022. It is now read-only.

How to apply the changes to old-array #68

@GloamZz

Description

@GloamZz

In my situation, I make diffing between two different classes packaged by the same enum.
As:
enum PackagingEnum: DiffAware {
case a(ClassA)
case b(ClassB)

var diffId: Int {
    switch self {
    case a(let classA):
        return classA.hashValue
    case b(let classB)
        return classB.hashValue
    }
}

}
in this case, I want to make diffing [ClassA] to [ClassB] via DeepDiff.

but when I get the changes by 'diff(old: [Enum-B], new: [Enum-A])'

I traverse the changes, and invoke 'insert/remove/move' in [Enum-B](the old), I get crashed because of 'Out of Range'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions