Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: jdgordon: r28714 - trunk/apps/gui/skin_engine

Re: 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 was last modified "Jan 10 2012" The Rockbox Crew
aaa