MCPcopy Create free account
hub / github.com/git/git / find_better_matching_suffix

Function find_better_matching_suffix

versioncmp.c:38–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36};
37
38static void find_better_matching_suffix(const char *tagname, const char *suffix,
39 int suffix_len, int start, int conf_pos,
40 struct suffix_match *match)
41{
42 /*
43 * A better match either starts earlier or starts at the same offset
44 * but is longer.
45 */
46 int end = match->len < suffix_len ? match->start : match->start-1;
47 int i;
48 for (i = start; i <= end; i++)
49 if (starts_with(tagname + i, suffix)) {
50 match->conf_pos = conf_pos;
51 match->start = i;
52 match->len = suffix_len;
53 break;
54 }
55}
56
57/*
58 * off is the offset of the first different character in the two strings

Callers 1

swap_prereleasesFunction · 0.85

Calls 1

starts_withFunction · 0.85

Tested by

no test coverage detected