All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Tanay Abhra <tanayabh@gmail.com>, git@vger.kernel.org
Cc: Ramkumar Ramachandra <artagnon@gmail.com>,
	Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
	Eric Sunshine <sunshine@sunshineco.com>
Subject: Re: [RFC/PATCH v2 1/2] config: Add hashtable for config parsing & retrieval
Date: Mon, 02 Jun 2014 21:33:54 +0200	[thread overview]
Message-ID: <538CD1A2.4020400@web.de> (raw)
In-Reply-To: <1401720460-6525-2-git-send-email-tanayabh@gmail.com>

On 2014-06-02 16.47, Tanay Abhra wrote:

[]
Please see 3 minor remarks inline.
> --- a/config.c
> +++ b/config.c
> @@ -9,6 +9,8 @@
>  #include "exec_cmd.h"
>  #include "strbuf.h"
>  #include "quote.h"
> +#include "hashmap.h"
> +#include "string-list.h"
>  
>  struct config_source {
>  	struct config_source *prev;
> @@ -37,6 +39,112 @@ static struct config_source *cf;
>  
>  static int zlib_compression_seen;
>  
> +static struct hashmap config_cache;
> +
> +struct config_cache_entry {
> +	struct hashmap_entry ent;
> +	char *key;
> +	struct string_list *value_list;
> +};
> +
> +static int hashmap_is_init = 0;
we don't need the " = 0", as all static data is initialized to 0 (or NULL) 
> +
> +static int config_cache_entry_cmp_icase(const struct config_cache_entry *e1,
> +				 const struct config_cache_entry *e2, const char* key)
the * should be aligned to the variable "key":
const char *key

[]

> +static void config_cache_set_value(const char *key, const char *value)
> +{
> +	struct config_cache_entry *e;
> +
> +	e = config_cache_find_entry(key);
> +	if (!e) {
> +		e = malloc(sizeof(*e));
I think we need xmalloc() here (from wrapper.c)

  reply	other threads:[~2014-06-02 19:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02 14:47 [RFC/PATCH v2 0/2] Git config cache & special querying api utilizing the cache Tanay Abhra
2014-06-02 14:47 ` [RFC/PATCH v2 1/2] config: Add hashtable for config parsing & retrieval Tanay Abhra
2014-06-02 19:33   ` Torsten Bögershausen [this message]
2014-06-03  7:58   ` Jeff King
2014-06-09  8:17   ` Eric Sunshine
2014-06-02 14:47 ` [RFC/PATCH v2 2/2] config: Add new query functions to the api docs Tanay Abhra
2014-06-03 15:35   ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=538CD1A2.4020400@web.de \
    --to=tboegi@web.de \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sunshine@sunshineco.com \
    --cc=tanayabh@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.