Summary: | Adding static method zero() to classes IntPoint and FloatPoint. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Luiz Agostini <luiz> | ||||||
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, darin | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Other | ||||||||
OS: | OS X 10.5 | ||||||||
Attachments: |
|
Description
Luiz Agostini
2010-04-07 11:05:17 PDT
Created attachment 52757 [details]
Patch
Comment on attachment 52757 [details]
Patch
If it's a class member, then it's IntPoint::zeroPoint(), which is worse than IntPoint(). I think we either need it to be:
inline IntPoint zeroIntPoint() { return IntPoint(); }
Or:
static IntPoint zero() { return IntPoint(); }
So we don't repeat the word point twice.
I also think we should do this for FloatPoint too.
(In reply to comment #2) > inline IntPoint zeroIntPoint() { return IntPoint(); } Outside the class, so it would be "zeroIntPoint()" at the call site. > static IntPoint zero() { return IntPoint(); } Inside the class, so it would be "IntPoint::zero()" at the call site. Created attachment 52776 [details]
Patch
Comment on attachment 52776 [details]
Patch
Thanks for implementing my suggestion. I think using this at various call sites instead of IntPoint() or IntPoint(0, 0) will make things a little more readable.
Comment on attachment 52776 [details] Patch Clearing flags on attachment: 52776 Committed r57236: <http://trac.webkit.org/changeset/57236> All reviewed patches have been landed. Closing bug. |