aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Henty <onepoint@starurchin.org>2009-05-07 16:27:17 -0400
committerJeremy Henty <onepoint@starurchin.org>2009-05-07 16:27:17 -0400
commit8841aa7963f24cc2384ba57bb1d5e69e74269fd1 (patch)
tree20e4d62bd91dab8ea2f19302394593c028213734 /src
parentbccf0ce1cc305acd8c1300f3abd3430b3a946ebe (diff)
Inlined Cache_client_make_key()
Diffstat (limited to 'src')
-rw-r--r--src/cache.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/cache.c b/src/cache.c
index ae8a512d..8ac859ac 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -136,18 +136,6 @@ void a_Cache_init(void)
/* Client operations ------------------------------------------------------ */
/*
- * Make a unique primary-key for cache clients
- */
-static int Cache_client_make_key(void)
-{
- static int ClientKey = 0; /* Provide a primary key for each client */
-
- if (++ClientKey <= 0)
- ClientKey = 1;
- return ClientKey;
-}
-
-/*
* Add a client to ClientQueue.
* - Every client-field is just a reference (except 'Web').
* - Return a unique number for identifying the client.
@@ -155,11 +143,13 @@ static int Cache_client_make_key(void)
static int Cache_client_enqueue(const DilloUrl *Url, DilloWeb *Web,
CA_Callback_t Callback, void *CbData)
{
- int ClientKey;
+ static int ClientKey = 0; /* Provide a primary key for each client */
CacheClient_t *NewClient;
+ if (++ClientKey <= 0)
+ ClientKey = 1;
+
NewClient = dNew(CacheClient_t, 1);
- ClientKey = Cache_client_make_key();
NewClient->Key = ClientKey;
NewClient->Url = Url;
NewClient->Version = 0;