AdaptiveDepth returns a safe tree depth based on repository size. Unknown file count (<=0) defaults to a conservative depth.
(fileCount int)
| 24 | // AdaptiveDepth returns a safe tree depth based on repository size. |
| 25 | // Unknown file count (<=0) defaults to a conservative depth. |
| 26 | func AdaptiveDepth(fileCount int) int { |
| 27 | if fileCount <= 0 { |
| 28 | return 2 |
| 29 | } |
| 30 | if fileCount > LargeRepoFileCount { |
| 31 | return 2 |
| 32 | } |
| 33 | if fileCount > MediumRepoFileCount { |
| 34 | return 3 |
| 35 | } |
| 36 | return 4 |
| 37 | } |
no outgoing calls