git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3.1/4] daemon: inline fill_in_extra_table_entries()

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Nov 22, 2008, 23:19 UTC
Message-ID
<4928936D.8010404@lsrfire.ath.cx>
In-Reply-To
<49289275.7090003@lsrfire.ath.cx>

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>
---
 daemon.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/daemon.c b/daemon.c
index 64f60c4..fbf61ca 100644
--- a/daemon.c
+++ b/daemon.c
@@ -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;
@@ -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.
@@ -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]);
-- 
1.6.0.4.755.g6e139
Previous: René ScharfeNext: René Scharfe
Message 5 of 7 in “add strbuf_expand_dict_cb(), a helper for simple cases”
  1. 1/4 add strbuf_expand_dict_cb(), a helper for simple casesRené Scharfe, Nov 22, 2008
  2. 2/4 merge-recursive: use strbuf_expand() instead of interpolate()René Scharfe, Nov 22, 2008
  3. 3/4 daemon: use strbuf_expand() instead of interpolate()René Scharfe, Nov 22, 2008
  4. 4/4 remove the unused files interpolate.c and interpolate.hRené Scharfe, Nov 22, 2008
  5. 1/4 daemon: inline fill_in_extra_table_entries()René Scharfe, Nov 22, 2008
  6. 2/4 daemon: deglobalize variable 'directory'René Scharfe, Nov 22, 2008
  7. Jon LoeligerDec 4, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.