From: Adam Dickmeiss Date: Thu, 6 Oct 2011 10:08:26 +0000 (+0200) Subject: Remove useless memset for database creation X-Git-Tag: v1.6.4~5^2~21 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;h=d5225315828a7592c1e91a39912f27f05d177062;p=pazpar2-moved-to-github.git Remove useless memset for database creation --- diff --git a/src/database.c b/src/database.c index 2a871a4..fd88d0b 100644 --- a/src/database.c +++ b/src/database.c @@ -106,13 +106,11 @@ struct database *new_database(const char *id, NMEM nmem) struct setting *idset; db = nmem_malloc(nmem, sizeof(*db)); - memset(db, 0, sizeof(*db)); - db->url = nmem_strdup(nmem, id); - db->num_settings = PZ_MAX_EOF; db->settings = nmem_malloc(nmem, sizeof(struct settings*) * db->num_settings); + db->next = 0; memset(db->settings, 0, sizeof(struct settings*) * db->num_settings); idset = nmem_malloc(nmem, sizeof(*idset)); idset->precedence = 0; @@ -120,7 +118,6 @@ struct database *new_database(const char *id, NMEM nmem) idset->target = idset->value = db->url; idset->next = 0; db->settings[PZ_ID] = idset; - db->next = 0; return db; }