From: Tom Rini Date: Tue, 4 Feb 2014 17:06:54 -0500 Subject: [U-Boot] [PATCH V4 04/12] cmd_test: use table lookup for parsing In-Reply-To: <1391458870-17930-4-git-send-email-swarren@wwwdotorg.org> References: <1391458870-17930-1-git-send-email-swarren@wwwdotorg.org> <1391458870-17930-4-git-send-email-swarren@wwwdotorg.org> Message-ID: <20140204220654.GT7049@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Feb 03, 2014 at 01:21:02PM -0700, Stephen Warren wrote: > From: Stephen Warren > > 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 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: