From 0ceb00093ac19044b2f8cfdef1422faef5247b0a Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Tue, 7 May 2024 08:42:45 -0700 Subject: [PATCH] Move notes to wiki --- text_diff_notes.md | 48 ---------------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 text_diff_notes.md diff --git a/text_diff_notes.md b/text_diff_notes.md deleted file mode 100644 index c4a183dead..0000000000 --- a/text_diff_notes.md +++ /dev/null @@ -1,48 +0,0 @@ -Consider changing: - -``` -foo(); -bar(); -``` - -To: - -``` -if (true) { - foo(); -} -``` - -What we want: - -``` -+ if (true) { - foo(); -- bar(); -+ } -``` - -A longest-common-subsequence algorithm is wrong here. The longest -subsequence is five tokens: - -``` -( ) ( ) ; -``` - -which leads to: - -``` -+if+ (+true+) +{+ - +foo+(); - -bar-(); -+}+ -``` - -so we claim `foo` is added. We want the following *four* tokens to be -preserved: - -``` -foo ( ) ; -``` - -Proposed solution: advance on both sides, keep first match.