vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 47287385bd2e9c2823d56fca280155889485471c parent 2efd2a3bd85a7077ab072df54aeb55f371c2b24a Author: Marc André Tanner <mat@brain-dump.org> Date: Mon, 2 Nov 2020 14:30:52 +0100 map: remove no longer used map_leaf function Diffstat:
| M | map.c | | | 13 | ------------- |
| M | map.h | | | 5 | ----- |
2 files changed, 0 insertions(+), 18 deletions(-)
diff --git a/map.c b/map.c @@ -78,19 +78,6 @@ bool map_contains(const Map *map, const char *prefix) return !map_empty(map_prefix(map, prefix)); } -static bool leaf(const char *key, void *value, void *data) -{ - int *nodes = data; - return (*nodes)++ < 1; -} - -bool map_leaf(const Map *map, const char *prefix) -{ - int nodes = 0; - map_iterate(map_prefix(map, prefix), leaf, &nodes); - return nodes == 1; -} - bool map_put(Map *map, const char *k, const void *value) { size_t len = strlen(k); diff --git a/map.h b/map.h @@ -35,11 +35,6 @@ void *map_closest(const Map*, const char *prefix); */ bool map_contains(const Map*, const char *prefix); /** - * Check whether the given prefix can be extended to exactly one map element. - * True iff the prefix map contains exactly one element. - */ -bool map_leaf(const Map*, const char *prefix); -/** * Store a key value pair in the map. * @return False if we run out of memory (``errno = ENOMEM``), or if the key * already appears in the map (``errno = EEXIST``).