[Webkit-unassigned] [Bug 42800] Upstream Android auto hyphenation implemenation to webkit

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 22 12:51:03 PDT 2010


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


Darin Adler <darin at apple.com> changed:

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




--- Comment #2 from Darin Adler <darin at apple.com>  2010-07-22 12:51:03 PST ---
(From update of attachment 62323)
There's a more elegant way to deal with the single hyphenation dictionary.

    static HyphenDict* dictionary = loadHyphenationDictionary();

Since you're only using it at one call site, you can use this there, and not have a "get" function. For one thing we don’t use "get" in our simple getter function names in WebKit. For another, there's no need for a separate boolean. If you did want a get function, it can be written like this.

    static HyphenDict* hyphenationDictionary()
    {
        static HyphenDict* staticDictionary = loadHyphenationDictionary();
        return staticDictionary;
    }

There's no reason for the boolean and to nest the entire function inside an if statement. It's also possibly more efficient to have the one time code out of line in a separate function.

r=me, though, as is.

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