Skip to content

Crash and inconsistent results when doing slight modifications to Example Code #64

@georgbachmann

Description

@georgbachmann

I am interested to find a good solution for multi-section diffing. So I came across Differ and though I am missing the functionality for detecting an update to an existing object I gave it a try.

A dataset like this creates a crash:

let items = [
       [
           StringArray(
               elements: [
                   "🌞",
                   "🐩",
               ],
               key: "First"
           ),
           StringArray(
               elements: [
                   "👋🏻",
                   "🎁",
                   "🐩",
               ],
               key: "Second"
           ),
       ],
       [
           StringArray(
               elements: [
                   "🎁",
                   "👋🏻",
               ],
               key: "Second"
           ),
           StringArray(
               elements: [
                   "🌞",
               ],
               key: "First"
           ),
           StringArray(
               elements: [
                   "🌞",
               ],
               key: "First"
           )
       ],
   ]

A dataset like this create inconsistant data when shuffling. Sometimes the order is correct, but sometimes it is't (see screenshot):

    let items = [
        [
            StringArray(
                elements: [
                    "🌞",
                    "🐩",
                ],
                key: "First"
            ),
            StringArray(
                elements: [
                    "👋🏻",
                    "🎁",
                    "🐩",
                ],
                key: "Second"
            ),
        ],
        [
            StringArray(
                elements: [
                    "🎁",
                    "👋🏻",
                ],
                key: "Second"
            ),
            StringArray(
                elements: [
                    "🌞",
                ],
                key: "First"
            ),
        ],
    ]

Bildschirmfoto 2019-11-26 um 09 46 43

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