Commit 5db345ea authored by Simon Zünd's avatar Simon Zünd Committed by V8 LUCI CQ

[liveedit] Enable Myers algorithm

This CL enables Myers algorithm introduced with
https://crrev.com/c/3804860.

Note that Myers finds slightly different diffs in some cases compared
to the current approach so this CL has to rebaseline one test.

R=kimanh@chromium.org

Bug: chromium:1205288
Change-Id: Ife4708a9edf543db938024a5e14c34a589d6a22a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3810244Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82247}
parent 0e60e79d
......@@ -40,9 +40,8 @@ class Comparator {
};
// Finds the difference between 2 arrays of elements.
static void CalculateDifference(
Input* input, Output* result_writer,
CompareMethod = CompareMethod::kDynamicProgramming);
static void CalculateDifference(Input* input, Output* result_writer,
CompareMethod = CompareMethod::kMyers);
};
} // namespace internal
......
......@@ -188,11 +188,11 @@ TEST(LiveEditTranslatePosition) {
CompareStringsOneWay("aabbaaaa", "aaaabbaa", &changes);
CHECK_EQ(LiveEdit::TranslatePosition(changes, 0), 0);
CHECK_EQ(LiveEdit::TranslatePosition(changes, 1), 1);
CHECK_EQ(LiveEdit::TranslatePosition(changes, 2), 4);
CHECK_EQ(LiveEdit::TranslatePosition(changes, 3), 5);
CHECK_EQ(LiveEdit::TranslatePosition(changes, 4), 6);
CHECK_EQ(LiveEdit::TranslatePosition(changes, 5), 7);
CHECK_EQ(LiveEdit::TranslatePosition(changes, 6), 8);
CHECK_EQ(LiveEdit::TranslatePosition(changes, 2), 2);
CHECK_EQ(LiveEdit::TranslatePosition(changes, 3), 3);
CHECK_EQ(LiveEdit::TranslatePosition(changes, 4), 2);
CHECK_EQ(LiveEdit::TranslatePosition(changes, 5), 3);
CHECK_EQ(LiveEdit::TranslatePosition(changes, 6), 6);
CHECK_EQ(LiveEdit::TranslatePosition(changes, 8), 8);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment