Explorar o código

Fix zero division in blobsAreClose()

Vadim Markovtsev %!s(int64=8) %!d(string=hai) anos
pai
achega
5c784116f1
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      analyser.go

+ 1 - 1
analyser.go

@@ -324,7 +324,7 @@ func (analyser *Analyser) blobsAreClose(
 			common += utf8.RuneCountInString(edit.Text)
 		}
 	}
-	return common*100/min(len(src), len(dst)) >=
+	return common*100/max(1, min(len(src), len(dst))) >=
 		analyser.SimilarityThreshold
 }