[Webkit-unassigned] [Bug 33954] YouTube HTML5 video never starts playing on Windows

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 5 13:53:11 PST 2010


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


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |darin at apple.com




--- Comment #5 from Darin Adler <darin at apple.com>  2010-02-05 13:53:11 PST ---
(In reply to comment #4)
> The "offending" line is testing the first character of a string:
> 
>     if (cookieURL.find('.') == 0)
>         cookieURL.remove(0);
> 
> I think the "correct" style would make the purpose of the test less clear.

That's an unnecessarily-inefficient idiom for checking the first character.
Instead you should write:

    if (cookieURL[0] == '.')
        cookieURL.remove(0);

The reason that works is that indexing with WebCore::String does a range check
and returns a 0 character if you index past the end.

This code is quite fast and won't scan the whole string.

-- 
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