Simplify WebFrame::isMainFrame
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.