MCPcopy Index your code
hub / github.com/coder/coder / indentGCD

Function indentGCD

agent/agentfiles/files.go:821–826  ·  view source on GitHub ↗

indentGCD returns the greatest common divisor of a and b. Used only by detectIndentUnit on positive space-lead lengths.

(a, b int)

Source from the content-addressed store, hash-verified

819// indentGCD returns the greatest common divisor of a and b. Used
820// only by detectIndentUnit on positive space-lead lengths.
821func indentGCD(a, b int) int {
822 for b != 0 {
823 a, b = b, a%b
824 }
825 return a
826}
827
828// translateIndentLevel returns the file-side lead for an inserted
829// splice line by translating the caller's indent level. rLead is

Callers 2

TestIndentGCDFunction · 0.85
detectIndentUnitFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIndentGCDFunction · 0.68