Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Investigate the more complex variants of Myers' diff algorithm #20

@fredemmott

Description

@fredemmott

This might result in better performance, and fewer hunks/more human-friendly diffs may be a side-effect (as it's closer to what other diff implementations use). It will not affect the length of the vec<DiffOp>

For example, diff and git diff produce:

@@ -1,5 +1,9 @@
 function testcase(): void {
-  some_function_with_a_long_name_and_several_args('aaaaaaaa', 'bbbbbbbb', 'cccccccc');
+  some_function_with_a_long_name_and_several_args(
+    'aaaaaaaa',
+    'bbbbbbbb',
+    'cccccccc',
+  );
   some_function_with_a_long_name_and_several_args(
     'xxxxxxxx',
     'yyyyyyyy',

Whereas difflib produces:

 function testcase(): void {
-  some_function_with_a_long_name_and_several_args('aaaaaaaa', 'bbbbbbbb', 'cccccccc');
   some_function_with_a_long_name_and_several_args(
+    'aaaaaaaa',
+    'bbbbbbbb',
+    'cccccccc',
+  );
+  some_function_with_a_long_name_and_several_args(
     'xxxxxxxx',
     'yyyyyyyy',
     'zzzzzzzz',

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions