Skip to content

Commit fe1fe4e

Browse files
committed
Revert "Update to delta method in diff match patch class to stop splitting surrogate pairs"
This reverts commit 395c5ae.
1 parent 0e35535 commit fe1fe4e

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

Simperium/src/main/java/name/fraser/neil/plaintext/diff_match_patch.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,22 +1429,7 @@ public int diff_levenshtein(LinkedList<Diff> diffs) {
14291429
*/
14301430
public String diff_toDelta(LinkedList<Diff> diffs) {
14311431
StringBuilder text = new StringBuilder();
1432-
char lastEnd = 0;
1433-
boolean isFirst = true;
14341432
for (Diff aDiff : diffs) {
1435-
char thisTop = aDiff.text.charAt(0);
1436-
char thisEnd = aDiff.text.charAt(aDiff.text.length() - 1);
1437-
if (Character.isHighSurrogate(thisEnd)) {
1438-
aDiff.text = aDiff.text.substring(0, aDiff.text.length() - 1);
1439-
}
1440-
if (! isFirst && Character.isHighSurrogate(lastEnd) && Character.isLowSurrogate(thisTop)) {
1441-
aDiff.text = lastEnd + aDiff.text;
1442-
}
1443-
isFirst = false;
1444-
lastEnd = thisEnd;
1445-
if ( aDiff.text.isEmpty() ) {
1446-
continue;
1447-
}
14481433
switch (aDiff.operation) {
14491434
case INSERT:
14501435
try {

0 commit comments

Comments
 (0)