[Webkit-unassigned] [Bug 98273] [BlackBerry] Implementing the NetworkInfo API for BB port
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Oct 3 14:31:49 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=98273
--- Comment #7 from Daniel Bates <dbates at webkit.org> 2012-10-03 14:32:13 PST ---
(In reply to comment #6)
> > Source/WebKit/blackberry/WebCoreSupport/NetworkInfoClientBlackBerry.cpp:108
> > + if (BlackBerry::Platform::NetworkInfo::instance()->getCurrentNetworkType() == BlackBerry::Platform::NetworkTypeCellular && m_isActive) {
>
> Unless calling BlackBerry::Platform::NetworkInfo::instance()->getCurrentNetworkType() has side-effects I suggest reversing the order of the conjuncts in this expression such that we check m_isActive first. A benefit of reversing the order is that when m_isActive is false we short-circuit the if conditional and hence don't evaluate "BlackBerry::Platform::NetworkInfo::instance()->getCurrentNetworkType() == BlackBerry::Platform::NetworkTypeCellular"; => avoid the function call BlackBerry::Platform::NetworkInfo::instance()->getCurrentNetworkType().
>
> You may also want to consider using an early return style here so as to avoid one level of indentation.
Actually, it's probably more common that when we get here m_isActive is true; => the order of these conjuncts is fine.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list