Skip to content

Commit

Permalink
daemon: inline fill_in_extra_table_entries()
Browse files Browse the repository at this point in the history
Having fill_in_extra_table_entries() as a separate function has no
advantage -- a function with no parameters and return values might as
well be an anonymous block of code.  Its name still refers to the table
of interpolate() which has been removed earlier, so it's better to
inline it at its only call site.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
René Scharfe authored and Junio C Hamano committed Nov 24, 2008
1 parent 9d7ca66 commit d433ed0
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ static void parse_extra_args(char *extra_args, int buflen)
char *val;
int vallen;
char *end = extra_args + buflen;
char *hp;

while (extra_args < end && *extra_args) {
saw_extended_args = 1;
Expand All @@ -438,11 +439,6 @@ static void parse_extra_args(char *extra_args, int buflen)
extra_args = val + vallen;
}
}
}

static void fill_in_extra_table_entries(void)
{
char *hp;

/*
* Replace literal host with lowercase-ized hostname.
Expand Down Expand Up @@ -562,10 +558,8 @@ static int execute(struct sockaddr *addr)
free(directory);
hostname = canon_hostname = ip_address = tcp_port = directory = NULL;

if (len != pktlen) {
if (len != pktlen)
parse_extra_args(line + len + 1, pktlen - len - 1);
fill_in_extra_table_entries();
}

for (i = 0; i < ARRAY_SIZE(daemon_service); i++) {
struct daemon_service *s = &(daemon_service[i]);
Expand Down

0 comments on commit d433ed0

Please sign in to comment.