[U-Boot] [PATCH V4 04/12] cmd_test: use table lookup for parsing

Tom Rini trini at ti.com
Tue Feb 4 23:06:54 CET 2014


On Mon, Feb 03, 2014 at 01:21:02PM -0700, Stephen Warren wrote:
> From: Stephen Warren <swarren at 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 <swarren at nvidia.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140204/64cda575/attachment.pgp>


More information about the U-Boot mailing list