Skip to content

Commit 5c75d47

Browse files
committed
increase score points for equality in needleman-wunsch, fixes #8980
* increasing the score fixes a subtle coloring issue where a closing square bracket would erroneously classified as deleted instead of matching.
1 parent 80943ee commit 5c75d47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/util/DiffUtil.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ object DiffUtil {
191191
}
192192

193193
private def needlemanWunsch(x: Array[String], y: Array[String], builder: mutable.ArrayBuilder[Patch]): Unit = {
194-
def similarity(a: String, b: String) = if (a == b) 2 else -1
194+
def similarity(a: String, b: String) = if (a == b) 3 else -1
195195
val d = 1
196196
val score = Array.tabulate(x.length + 1, y.length + 1) { (i, j) =>
197197
if (i == 0) d * j

0 commit comments

Comments
 (0)