]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
util: remove redundant loop condition in argconfig_parse()
authorCaleb Sander Mateos <csander@purestorage.com>
Tue, 16 Jul 2024 19:11:34 +0000 (13:11 -0600)
committerDaniel Wagner <wagi@monom.org>
Wed, 17 Jul 2024 14:57:45 +0000 (16:57 +0200)
Since options_count is computed as the number of options
until the first one with a NULL option field,
s->option and option_index < options_count are equivalent.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
util/argconfig.c

index 3424e6913d409c89cbe4afa2d4a484f016aee49c..371ab7f3fc595209c0e06ed32642cf99682c40f4 100644 (file)
@@ -316,7 +316,7 @@ int argconfig_parse(int argc, char *argv[], const char *program_desc,
                return -errno;
        }
 
-       for (s = options; s->option && option_index < options_count; s++) {
+       for (s = options; s->option; s++) {
                if (s->short_option) {
                        short_opts[short_index++] = s->short_option;
                        if (s->argument_type == required_argument ||