]> git.puffer.fish Git - matthieu/frr.git/commitdiff
vtysh: Improve lookup performance
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 30 Jun 2020 13:03:55 +0000 (09:03 -0400)
committerIgor Ryzhov <iryzhov@nfware.com>
Mon, 13 Jul 2020 16:07:04 +0000 (19:07 +0300)
When we find the line we are interested in, stop looking.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
vtysh/vtysh_config.c

index 2ab9dd5a9adcbb5238e63ebb957b169051807ff8..61bcf3b658d06fe870701129ac73e3b9d1e514d0 100644 (file)
@@ -97,8 +97,10 @@ static struct config *config_get(int index, const char *line)
        }
 
        frr_each (config_master, master, config_loop) {
-               if (strcmp(config_loop->name, line) == 0)
+               if (strcmp(config_loop->name, line) == 0) {
                        config = config_loop;
+                       break;
+               }
        }
 
        if (!config) {