]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: remove `vector_get_index()`
authorDavid Lamparter <equinox@opensourcerouting.org>
Mon, 8 Nov 2021 13:07:30 +0000 (14:07 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Mon, 8 Nov 2021 13:07:30 +0000 (14:07 +0100)
... its only purpose was to serve as a footgun, and all such uses have
been eliminated now.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/vector.c
lib/vector.h

index 38f9b1b85fd43a379654a10392bf6b5a21cedb13..5497c242803bd9a535d06c5e447059b4de681926 100644 (file)
@@ -136,17 +136,6 @@ int vector_set_index(vector v, unsigned int i, void *val)
        return i;
 }
 
-/* Make a specified index slot active and return its address. */
-void **vector_get_index(vector v, unsigned int i)
-{
-       vector_ensure(v, i);
-
-       if (v->active <= i)
-               v->active = i + 1;
-
-       return &v->index[i];
-}
-
 /* Look up vector.  */
 void *vector_lookup(vector v, unsigned int i)
 {
index 6208be1cc7f1e324044f7f3beb922fb03a97bcc1..71c497a1b796b3a1dd437dae413c33a1adbd496d 100644 (file)
@@ -55,7 +55,6 @@ extern void vector_ensure(vector v, unsigned int num);
 extern int vector_empty_slot(vector v);
 extern int vector_set(vector v, void *val);
 extern int vector_set_index(vector v, unsigned int i, void *val);
-extern void **vector_get_index(vector v, unsigned int i);
 extern void vector_unset(vector v, unsigned int i);
 extern void vector_unset_value(vector v, void *val);
 extern void vector_remove(vector v, unsigned int ix);