]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/string-table.c
network: drop all checks of ipv6_disabled sysctl
[thirdparty/systemd.git] / src / basic / string-table.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2
3 #include "string-table.h"
4 #include "string-util.h"
5
6 ssize_t string_table_lookup(const char * const *table, size_t len, const char *key) {
7 size_t i;
8
9 if (!key)
10 return -1;
11
12 for (i = 0; i < len; ++i)
13 if (streq_ptr(table[i], key))
14 return (ssize_t) i;
15
16 return -1;
17 }