MCPcopy Create free account
hub / github.com/decomp/decomp / matchLen

Function matchLen

cmd/go-post/fix.go:537–543  ·  view source on GitHub ↗

matchLen returns the length of the longest prefix shared by x and y.

(x, y string)

Source from the content-addressed store, hash-verified

535
536// matchLen returns the length of the longest prefix shared by x and y.
537func matchLen(x, y string) int {
538 i := 0
539 for i < len(x) && i < len(y) && x[i] == y[i] {
540 i++
541 }
542 return i
543}
544
545// addImport adds the import path to the file f, if absent.
546func addImport(f *ast.File, ipath string) (added bool) {

Callers 1

addImportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected