Home / Function/ longestCommonPrefix() — gin Function Reference

longestCommonPrefix() — gin Function Reference

Architecture documentation for the longestCommonPrefix() function in tree.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  3704439d_36e6_842b_bfc9_783f6357fe17["longestCommonPrefix()"]
  c26db86d_6014_ffb1_aad9_2c5f3b61998b["tree.go"]
  3704439d_36e6_842b_bfc9_783f6357fe17 -->|defined in| c26db86d_6014_ffb1_aad9_2c5f3b61998b
  style 3704439d_36e6_842b_bfc9_783f6357fe17 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tree.go lines 61–68

func longestCommonPrefix(a, b string) int {
	i := 0
	max_ := min(len(a), len(b))
	for i < max_ && a[i] == b[i] {
		i++
	}
	return i
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does longestCommonPrefix() do?
longestCommonPrefix() is a function in the gin codebase, defined in tree.go.
Where is longestCommonPrefix() defined?
longestCommonPrefix() is defined in tree.go at line 61.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free