MCPcopy Index your code
hub / github.com/git/git / scale_linear

Function scale_linear

diff.c:2839–2850  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2837const char mime_boundary_leader[] = "------------";
2838
2839static int scale_linear(int it, int width, int max_change)
2840{
2841 if (!it)
2842 return 0;
2843 /*
2844 * make sure that at least one '-' or '+' is printed if
2845 * there is any change to this path. The easiest way is to
2846 * scale linearly as if the allotted width is one column shorter
2847 * than it is, and then add 1 to the result.
2848 */
2849 return 1 + (it * (width - 1) / max_change);
2850}
2851
2852static void show_graph(struct strbuf *out, char ch, int cnt,
2853 const char *set, const char *reset)

Callers 1

show_statsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected