When doing micro-optimisations, then go all the way: Use memcmp() instead of strncmp().
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 14 Sep 2011 09:18:52 +0000 (11:18 +0200)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 14 Sep 2011 09:18:52 +0000 (11:18 +0200)
driver/firm_opt.c

index 50beb48..13ec9a0 100644 (file)
@@ -931,7 +931,7 @@ int firm_option(const char *const opt)
        size_t const len = strlen(opt);
        for (size_t i = lengthof(firm_options); i != 0;) {
                struct params const* const o = &firm_options[--i];
-               if (len == o->opt_len && strncmp(opt, o->option, len) == 0) {
+               if (len == o->opt_len && memcmp(opt, o->option, len) == 0) {
                        /* statistic options do accumulate */
                        if (o->flag == &firm_dump.statistic)
                                *o->flag = (bool) (*o->flag | o->set);