diff options
author | 2021-02-25 17:27:26 +0200 | |
---|---|---|
committer | 2021-02-25 17:27:26 +0200 | |
commit | 2daea54cac437e34b2c5223cfc33387d3a7aee28 (patch) | |
tree | bee68d51747994bede9edd7d8f657aecdb387c1e | |
parent | 361c1a693c50e42df849f5d68642552d4a99aa4a (diff) | |
download | algos-ld1-2daea54cac437e34b2c5223cfc33387d3a7aee28.tar.gz algos-ld1-2daea54cac437e34b2c5223cfc33387d3a7aee28.tar.bz2 algos-ld1-2daea54cac437e34b2c5223cfc33387d3a7aee28.zip |
get rid of pnode, t'was unused.
Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
-rw-r--r-- | src/cache.c | 9 | ||||
-rw-r--r-- | src/defs.h | 3 | ||||
-rw-r--r-- | 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 <errno.h> #include <stdlib.h> @@ -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; @@ -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; @@ -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, |