RESOLVED FIXED 127812
Simplify WebFrame::isMainFrame
https://bugs.webkit.org/show_bug.cgi?id=127812
Summary Simplify WebFrame::isMainFrame
Anders Carlsson
Reported 2014-01-28 15:51:03 PST
Simplify WebFrame::isMainFrame
Attachments
Patch (1.32 KB, patch)
2014-01-28 15:51 PST, Anders Carlsson
sam: review+
Anders Carlsson
Comment 1 2014-01-28 15:51:30 PST
Sergio Correia (qrwteyrutiyoup)
Comment 2 2014-01-28 16:05:27 PST
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;
Anders Carlsson
Comment 3 2014-01-28 16:08:07 PST
(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.
Anders Carlsson
Comment 4 2014-01-28 16:11:27 PST
Darin Adler
Comment 5 2014-01-29 10:06:49 PST
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.
Note You need to log in before you can comment on or make changes to this bug.