Re: replacing if-then-else strcmp ladders with switch cases

2020-06-13 Thread jim . cromie
On Fri, Jun 12, 2020 at 11:02 PM Valdis Klētnieks wrote: > > On Fri, 12 Jun 2020 12:05:55 -0600, jim.cro...@gmail.com said: > > considering lib/dynamic_debug.c > > we have > > > > ... > > } else if (!strcmp(words[i], "module")) { > > rc = check_set(>module, words[i+1], "module"); > > } else

Re: replacing if-then-else strcmp ladders with switch cases

2020-06-12 Thread Valdis Klētnieks
On Fri, 12 Jun 2020 12:05:55 -0600, jim.cro...@gmail.com said: > considering lib/dynamic_debug.c > we have > > ... > } else if (!strcmp(words[i], "module")) { > rc = check_set(>module, words[i+1], "module"); > } else if (!strcmp(words[i], "format")) { > ... > > are there any built-in hash