[webkit-reviews] review granted: [Bug 42800] Upstream Android auto hyphenation implemenation to webkit : [Attachment 62323] Implment auto hyphenation interface for Android.

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


Darin Adler <darin at apple.com> has granted sw <swang at google.com>'s request for
review:
Bug 42800: Upstream Android auto hyphenation implemenation to webkit
https://bugs.webkit.org/show_bug.cgi?id=42800

Attachment 62323: Implment auto hyphenation interface for Android.
https://bugs.webkit.org/attachment.cgi?id=62323&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
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.


More information about the webkit-reviews mailing list