Summary: | Simplify WebFrame::isMainFrame | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Anders Carlsson <andersca> | ||||
Component: | New Bugs | Assignee: | Anders Carlsson <andersca> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | ||||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Anders Carlsson
2014-01-28 15:51:03 PST
Created attachment 222520 [details]
Patch
Comment on attachment 222520 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=222520&action=review > Source/WebKit2/WebProcess/WebPage/WebFrame.cpp:372 > + return m_coreFrame->isMainFrame(); maybe a ternary here would be cleaner? return m_coreFrame ? m_coreFrame->isMainFrame() : false; (In reply to comment #2) > (From update of attachment 222520 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=222520&action=review > > > Source/WebKit2/WebProcess/WebPage/WebFrame.cpp:372 > > + return m_coreFrame->isMainFrame(); > > maybe a ternary here would be cleaner? > return m_coreFrame ? m_coreFrame->isMainFrame() : false; I think the explicit null check is easier to follow. Committed r162980: <http://trac.webkit.org/changeset/162980> Comment on attachment 222520 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=222520&action=review >>> Source/WebKit2/WebProcess/WebPage/WebFrame.cpp:372 >>> + return m_coreFrame->isMainFrame(); >> >> maybe a ternary here would be cleaner? >> return m_coreFrame ? m_coreFrame->isMainFrame() : false; > > I think the explicit null check is easier to follow. I think that && is easier to follow than the if statement or the ternary. return m_coreFrame && m_coreFrame->isMainFrame(); But tastes may differ, I suppose. |