Summary: | [Mac][Chromium-Mac] Implement LocaleMac::dateFormat | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Kent Tamura <tkent> | ||||
Component: | Platform | Assignee: | Kent Tamura <tkent> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | morrita, webkit.review.bot | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Bug Depends on: | 98109 | ||||||
Bug Blocks: | 97997, 98383 | ||||||
Attachments: |
|
Description
Kent Tamura
2012-10-01 22:52:42 PDT
Created attachment 166627 [details]
Patch
Comment on attachment 166627 [details] Patch Rejecting attachment 166627 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 1 ERROR: /mnt/git/webkit-commit-queue/Source/WebCore/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive). Full output: http://queues.webkit.org/results/14129438 Oops, the ChangeLog has no "Reviewed by" line. Committed r130243: <http://trac.webkit.org/changeset/130243> Comment on attachment 166627 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=166627&action=review > Source/WebCore/platform/text/mac/LocaleMac.mm:257 > + if (!m_dateFormat.isEmpty()) I suggest using isNull, more efficient, here. > Source/WebCore/platform/text/mac/LocaleMac.mm:260 > + RetainPtr<NSDateFormatter> formatter(AdoptNS, createShortDateFormatter()); > + m_dateFormat = String([formatter.get() dateFormat]); The explicit String() here is unneeded, I believe. I would write this: if (m_dateFormat.isNull()) m_dateFormat = [adoptNS(createShortDateFormatter()).get() dateFormat]; return m_dateFormat; And later createShortDateFormatter should be changed to return a RetainPtr instead of a raw pointer, which would eliminate the need for the adoptNS call here. (In reply to comment #5) > > Source/WebCore/platform/text/mac/LocaleMac.mm:257 > > + if (!m_dateFormat.isEmpty()) > > I suggest using isNull, more efficient, here. > > > Source/WebCore/platform/text/mac/LocaleMac.mm:260 > > + RetainPtr<NSDateFormatter> formatter(AdoptNS, createShortDateFormatter()); > > + m_dateFormat = String([formatter.get() dateFormat]); > > The explicit String() here is unneeded, I believe. > > I would write this: > > if (m_dateFormat.isNull()) > m_dateFormat = [adoptNS(createShortDateFormatter()).get() dateFormat]; > return m_dateFormat; > > And later createShortDateFormatter should be changed to return a RetainPtr instead of a raw pointer, which would eliminate the need for the adoptNS call here. Thank you for the suggestions! I filed Bug 98383, and uploaded a patch for them. |