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

Method DiffCommonSuffix

diffmatchpatch/diff.go:427–430  ·  view source on GitHub ↗

DiffCommonSuffix determines the common suffix length of two strings.

(text1, text2 string)

Source from the content-addressed store, hash-verified

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

Callers 3

TestDiffCommonSuffixFunction · 0.80

Calls 1

commonSuffixLengthFunction · 0.85

Tested by 2

TestDiffCommonSuffixFunction · 0.64