From 2daea54cac437e34b2c5223cfc33387d3a7aee28 Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Thu, 25 Feb 2021 17:27:26 +0200 Subject: get rid of pnode, t'was unused. Signed-off-by: Gediminas Jakutis --- src/cache.c | 9 +++------ src/defs.h | 3 +-- src/main.c | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/cache.c b/src/cache.c index 19c5a92..5443e28 100644 --- a/src/cache.c +++ b/src/cache.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ -/* Copyright (C) 2020 Gediminas Jakutis */ +/* Copyright (C) 2020-2021 Gediminas Jakutis */ #include #include @@ -230,15 +230,13 @@ int cached_put_list(struct stream * const restrict in, const struct entry_l * co int ret = 0; if (!in->cnode) { /* if this is the very first one */ - in->pnode = NULL; in->cnode = in->cache_l; in->cnode->val = node->val; in->cnode->next = NULL; in->index = 0; } else { - in->pnode = in->cnode; - in->cnode = in->cnode + 1; /* lol says librin, lmao */ - in->pnode->next = in->cnode; + in->cnode->next = in->cnode + 1; /* lol says librin, lmao */ + in->cnode = in->cnode->next; in->cnode->val = node->val; in->cnode->next = NULL; ++in->index; @@ -251,7 +249,6 @@ int cache_rewind(struct stream * const in) { int ret = 0; - in->pnode = NULL; in->cnode = in->cnode ? in->cache_l : NULL; in->index = 0; diff --git a/src/defs.h b/src/defs.h index e90f0e5..a0d61cd 100644 --- a/src/defs.h +++ b/src/defs.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ -/* Copyright (C) 2020 Gediminas Jakutis */ +/* Copyright (C) 2020-2021 Gediminas Jakutis */ #ifndef ALGOS_DEFS_H_INCLUDED #define ALGOS_DEFS_H_INCLUDED @@ -100,7 +100,6 @@ struct stream { enum streamtype type; char *name; size_t index; - struct entry_l *pnode; /* "previous" node */ struct entry_l *cnode; /* "current" node */ union cachewrap; struct settings *settings; diff --git a/src/main.c b/src/main.c index ccdbfc2..9d66594 100644 --- a/src/main.c +++ b/src/main.c @@ -26,7 +26,7 @@ static int stub_split(struct stream * const in, struct stream * const a, struct static const struct stream stream_blank = { .n = 0, .type = stream_invalid, .fd = -1, .settings = &settings, - .name = NULL, .index = 0, .pnode = NULL, .cnode = NULL, .cache = NULL, + .name = NULL, .index = 0, .cnode = NULL, .cache = NULL, .get_next_element_direct = stub_getnext, .get_next_element_cache = stub_getnext, .place_next_element_direct = stub_put, -- cgit v1.2.3