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
  d5014715_c0ae_9699_24c7_2e76e5802f19["longestCommonPrefix()"]
  1e254bd3_e110_d850_2675_5cdfb2b748aa["addRoute()"]
  1e254bd3_e110_d850_2675_5cdfb2b748aa -->|calls| d5014715_c0ae_9699_24c7_2e76e5802f19
  style d5014715_c0ae_9699_24c7_2e76e5802f19 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

Called By

Frequently Asked Questions

What does longestCommonPrefix() do?
longestCommonPrefix() is a function in the gin codebase.
What calls longestCommonPrefix()?
longestCommonPrefix() is called by 1 function(s): addRoute.

Analyze Your Own Codebase

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

Try Supermodel Free