[Webkit-unassigned] [Bug 44107] CSS: Make rgb() and rgba() fast paths case-insensitive

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 18 10:26:01 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=44107


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #64719|review?                     |review+
               Flag|                            |




--- Comment #5 from Darin Adler <darin at apple.com>  2010-08-18 10:26:01 PST ---
(From update of attachment 64719)
> +static inline bool mightBeRGBA(const UChar* characters, unsigned length)
> +{
> +    if (length < 5)
> +        return false;
> +    return characters[4] == '('
> +        && (characters[0] == 'r' || characters[0] == 'R')
> +        && (characters[1] == 'g' || characters[1] == 'G')
> +        && (characters[2] == 'b' || characters[2] == 'B')
> +        && (characters[3] == 'a' || characters[3] == 'A');
> +}

This kind of check can be done considerably more efficiently like this:

    && (characters[0] | 0x20) == 'r'
    && (characters[1] | 0x20) == 'b'

r=me as-is but consider my faster version

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list