summaryrefslogtreecommitdiffstats
path: root/vtysh
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-06-30 15:03:55 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2020-06-30 15:03:55 +0200
commite8938601e2c2999e215da6e96908273b6d98458e (patch)
tree6d15a760606e487844f2b91ff142eed8ae06a8c5 /vtysh
parentvtysh: master is a non-sorted list (diff)
downloadfrr-e8938601e2c2999e215da6e96908273b6d98458e.tar.xz
frr-e8938601e2c2999e215da6e96908273b6d98458e.zip
vtysh: Improve lookup performance
When we find the line we are interested in, stop looking. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/vtysh_config.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c
index 2ab9dd5a9..61bcf3b65 100644
--- a/vtysh/vtysh_config.c
+++ b/vtysh/vtysh_config.c
@@ -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) {