[Webkit-unassigned] [Bug 54764] New: Remove redundant code in qt/WebCoreSupport
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Feb 18 12:10:47 PST 2011
https://bugs.webkit.org/show_bug.cgi?id=54764
Summary: Remove redundant code in qt/WebCoreSupport
Product: WebKit
Version: 528+ (Nightly build)
Platform: All
OS/Version: All
Status: UNCONFIRMED
Severity: Trivial
Priority: P2
Component: WebKit Qt
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: fabrizio.machado at nokia.com
The source files NotificationPresenterClientQt.cpp and DumpRenderTreeSupportQt.cpp have redundant checks after static_cast.
In NotificationPresenterClientQt.cpp, the final "if()" is not needed:
=========================================================
if (!context || context->isWorkerContext())
return 0;
Document* document = static_cast<Document*>(context);
if (!document)
return 0;
=========================================================
The context pointer has already been checked, so it must be non-NULL when the static_cast occurs. Thus, document will not be NULL and the check is redundant.
Similarly, in DumpRenderTreeSupportQt.cpp:
=========================================================
if (!coreNode || !coreNode->renderer())
return false;
HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(coreNode);
if (!inputElement)
return false;
=========================================================
coreNode has already been checked and is non-NULL when the static_cast to HTMLInputElement* occurs. The check after the cast is not needed.
--
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