diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-03-06 00:59:07 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-07-20 23:52:51 +0200 |
| commit | fa4745b4bac682f0a265b956a90bb7a84ef51192 (patch) | |
| tree | 937111686b922c19e3f683a0363b94f810e8b54f | |
| parent | 4ef6d1b86f601e6a288e6c8cb399d3d0888ca783 (diff) | |
Perform some minor optimizations
| -rw-r--r-- | handler.c | 5 | ||||
| -rw-r--r-- | handler.h | 1 |
2 files changed, 2 insertions, 4 deletions
@@ -311,8 +311,7 @@ int handler_add(struct handler *const h, const char *url, const enum http_op op, const handler_fn f, void *const user) { const size_t n = h->n_cfg + 1; - struct handler_cfg *const cfgs = realloc(h->cfg, n * sizeof *h->cfg), - *c = NULL; + struct handler_cfg *const cfgs = realloc(h->cfg, n * sizeof *h->cfg); if (!cfgs) { @@ -320,7 +319,7 @@ int handler_add(struct handler *const h, const char *url, return -1; } - c = &cfgs[h->n_cfg]; + struct handler_cfg *const c = &cfgs[h->n_cfg]; *c = (const struct handler_cfg) { @@ -4,7 +4,6 @@ #include "http.h" #include <stddef.h> -struct handler; typedef int (*handler_fn)(const struct http_payload *p, struct http_response *r, void *user); |
