Vasyl' Vavrychuk [off-list ref] writes:
Extract compact code into trim_url. Dont call it every iteration in the loop since no reason.
Too long a line; just drop " since no reason".
quoted hunk ↗ jump to hunk
@@ -379,14 +394,6 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
what = rm->name;
}
- url_len = strlen(url);
- for (i = url_len - 1; url[i] == '/' && 0 <= i; i--)
- ;
- url_len = i + 1;
- if (4 < i && !strncmp(".git", url + i - 3, 4))
- url_len = i - 3;
- url[url_len] = '\0';
-
note_len = 0;
if (*what) {
if (*kind)
We repeatedly called strlen(url) for each entry in the ref-map when we
know we do not have any more thing to do; silly. This is probably a good
thing to do.