]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
libkmod: inline _idx_empty_str
authorEmil Velikov <emil.l.velikov@gmail.com>
Mon, 4 Nov 2024 14:32:39 +0000 (14:32 +0000)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 7 Nov 2024 19:43:49 +0000 (13:43 -0600)
The compiler already creates an empty string as applicable, drop the
extra variable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/224
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
libkmod/libkmod-index.c

index e9387a6c919ddc78c1c2dc101f12e3c6ee34fd99..0c0078908e20d44d1b6536c52b9424e0071234e1 100644 (file)
@@ -599,8 +599,6 @@ struct index_value *index_searchwild(struct index_file *in, const char *key)
 #include <sys/stat.h>
 #include <unistd.h>
 
-static const char _idx_empty_str[] = "";
-
 struct index_mm {
        const struct kmod_ctx *ctx;
        void *mm;
@@ -673,7 +671,7 @@ static struct index_mm_node *index_mm_read_node(struct index_mm *idx, uint32_t o
                size_t len;
                node->prefix = read_chars_mm(&p, &len);
        } else {
-               node->prefix = _idx_empty_str;
+               node->prefix = "";
        }
 
        if (offset & INDEX_NODE_CHILDS) {