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

Method DiffCommonSuffix

diffmatchpatch/diff.go:431–434  ·  view source on GitHub ↗

DiffCommonSuffix determines the common suffix length of two strings.

(text1, text2 string)

Source from the content-addressed store, hash-verified

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

Callers 2

TestDiffCommonSuffixFunction · 0.80

Calls 1

commonSuffixLengthFunction · 0.85

Tested by 2

TestDiffCommonSuffixFunction · 0.64