Hi Stephen, On 27 January 2014 13:49, Stephen Warren <swar...@wwwdotorg.org> wrote: > From: Stephen Warren <swar...@nvidia.com> > > do_test() currently uses strcmp() twice to determine which operator is > present; once to determine how many arguments the operator needs, then > a second time to actually decode the operator and implement it. > > Rewrite the code so that a table lookup is used to translate the operator > string to an integer, and use a more efficient switch statement to decode > and execute the operator. > > This approach also acts as enablement for the following patches. > > This patch should introduce no behavioural change. > > Signed-off-by: Stephen Warren <swar...@nvidia.com> > --- > v3: New patch.
Wow that's some interesting code...it took me a while to understand both the old and the new code. It looks correct to me but I wonder if it is deserving of some tests? Something like test/command_ut.c might show a simple way to run some tests. Regards, Simon _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot