diff options
author | Linkerist <Linkerist@163.com> | 2018-06-14 00:21:47 +0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2018-06-27 13:12:27 -0700 |
commit | 11016ec091b8a72a5b45787857451692bd7bcab7 (patch) | |
tree | 022542c0157ca8d049f17cdd4db949d3b0b7883d /storage.c | |
parent | 7b431de560f13e47dd171fa77e189514aa8088ce (diff) | |
download | memcached-11016ec091b8a72a5b45787857451692bd7bcab7.tar.gz |
add utility macro to replace repetitive code snippit.
Diffstat (limited to 'storage.c')
-rw-r--r-- | storage.c | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -42,14 +42,7 @@ int lru_maintainer_store(void *storage, const int clsid) { uint32_t flags; if ((it->it_flags & ITEM_HDR) == 0 && (item_age == 0 || current_time - it->time > item_age)) { - // FIXME: flag conversion again - if (settings.inline_ascii_response) { - flags = (uint32_t) strtoul(ITEM_suffix(it), (char **) NULL, 10); - } else if (it->nsuffix > 0) { - flags = *((uint32_t *)ITEM_suffix(it)); - } else { - flags = 0; - } + FLAGS_CONV(settings.inline_ascii_response, it, flags); item *hdr_it = do_item_alloc(ITEM_key(it), it->nkey, flags, it->exptime, sizeof(item_hdr)); /* Run the storage write understanding the start of the item is dirty. * We will fill it (time/exptime/etc) from the header item on read. |