basic/string-table: reduce variable scope

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-07-16 15:57:36 +02:00
parent 5992f362bf
commit 6b9f5f01cb

View file

@ -4,12 +4,10 @@
#include "string-util.h"
ssize_t string_table_lookup(const char * const *table, size_t len, const char *key) {
size_t i;
if (!key)
return -1;
for (i = 0; i < len; ++i)
for (size_t i = 0; i < len; ++i)
if (streq_ptr(table[i], key))
return (ssize_t) i;