summaryrefslogtreecommitdiffstats
path: root/vtysh/vtysh.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-06-17 01:27:41 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-06-17 02:09:45 +0200
commit626e8d0a9b4830438276947d0c76d1fbf4c7884c (patch)
tree5cce0ff596a34a13e2c813c8a936eb693b56fcef /vtysh/vtysh.c
parentlib, vtysh: Add 'show thread poll' command (diff)
downloadfrr-626e8d0a9b4830438276947d0c76d1fbf4c7884c.tar.xz
frr-626e8d0a9b4830438276947d0c76d1fbf4c7884c.zip
lib: A small optimization for the hash iterate and walk functions
When we are iterating through the hash, keep count of how many we've called and if we have finished calling the hash->size iterator times, then short-circuit and stop looping over the entire array. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r--vtysh/vtysh.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 4ac744839..65223d02b 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -2144,7 +2144,6 @@ DEFUN (vtysh_show_poll,
"Thread Poll Information\n")
{
unsigned int i;
- int idx = 0;
int ret = CMD_SUCCESS;
char line[100];