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

Method DiffCommonPrefix

diffmatchpatch/diff.go:421–424  ·  view source on GitHub ↗

DiffCommonPrefix determines the common prefix length of two strings.

(text1, text2 string)

Source from the content-addressed store, hash-verified

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

Callers 2

TestDiffCommonPrefixFunction · 0.80

Calls 1

commonPrefixLengthFunction · 0.85

Tested by 2

TestDiffCommonPrefixFunction · 0.64