MCPcopy Create free account
hub / github.com/sergi/go-diff / DiffCommonPrefix

Method DiffCommonPrefix

diffmatchpatch/diff.go:425–428  ·  view source on GitHub ↗

DiffCommonPrefix determines the common prefix length of two strings.

(text1, text2 string)

Source from the content-addressed store, hash-verified

423
424// DiffCommonPrefix determines the common prefix length of two strings.
425func (dmp *DiffMatchPatch) DiffCommonPrefix(text1, text2 string) int {
426 // Unused in this code, but retained for interface compatibility.
427 return commonPrefixLength([]rune(text1), []rune(text2))
428}
429
430// DiffCommonSuffix determines the common suffix length of two strings.
431func (dmp *DiffMatchPatch) DiffCommonSuffix(text1, text2 string) int {

Callers 2

TestDiffCommonPrefixFunction · 0.80

Calls 1

commonPrefixLengthFunction · 0.85

Tested by 2

TestDiffCommonPrefixFunction · 0.64