Skip to content

Diffing two strings sometimes adds a blank change  #2

Description

@halostatue

Diffing two strings sometimes adds a blank change

Sometimes when I diff two strings, the resulting array has a blank change.
For example:

Diff::LCS.diff 'hi', 'hie'

returns a two-element array where the first is a Diff::LCS::Change with @element="". I don't know why that
is there at all.

Diff::LCS.diff 'hi', 'hi'

should return an empty array but instead returns an array with the blank change (@element = "").

This does not always happen, as in the case with:

Diff::LCS.diff 'hie', 'hi'

correctly returns a one-element array.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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