|
Rockbox mail archiveSubject: Re: jdgordon: r28714 - trunk/apps/gui/skin_engineRe: jdgordon: r28714 - trunk/apps/gui/skin_engine
From: Jonathan Gordon <jdgordy_at_gmail.com>
Date: Wed, 1 Dec 2010 09:15:33 +1100 On 1 December 2010 01:07, Magnus Holmgren <magnushol_at_gmail.com> wrote: > On Tue, Nov 30, 2010 at 14:12, <mailer_at_svn.rockbox.org> wrote: >> Date: 2010-11-30 14:12:27 +0100 (Tue, 30 Nov 2010) >> New Revision: 28714 >> >> Log Message: >> Very small code shuffle to maybe make parseing %if() a smidgen faster > > <...> > >> - if (!strcmp(op, "=")) >> + if (!strncmp(op, "=", 1)) > > If anything, it actually makes it slower. strcmp aborts as soon as > either string ends. strncmp does that too, but it also need to check > the count (in the implementation Rockbox uses, it is checked two times > per char). > > :) > > -- > Magnus > strncmp was also used because otherwsie it was actually broken. I'm pretty sure the parser does not strip trailing spaces, so %if(foo, = , bar) would get rejected. The mentioned speedup was more hopefully from it not checking every case once one was found. Received on 2010-11-30 Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy |