WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
54764
Remove redundant code in qt/WebCoreSupport
https://bugs.webkit.org/show_bug.cgi?id=54764
Summary
Remove redundant code in qt/WebCoreSupport
Fabrizio
Reported
2011-02-18 12:10:47 PST
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.
Attachments
remove redundant checks
(1.91 KB, patch)
2011-02-18 12:20 PST
,
Fabrizio
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Fabrizio
Comment 1
2011-02-18 12:20:54 PST
Created
attachment 82995
[details]
remove redundant checks
WebKit Commit Bot
Comment 2
2011-02-18 21:58:06 PST
Comment on
attachment 82995
[details]
remove redundant checks Clearing flags on attachment: 82995 Committed
r79098
: <
http://trac.webkit.org/changeset/79098
>
WebKit Commit Bot
Comment 3
2011-02-18 21:58:11 PST
All reviewed patches have been landed. Closing bug.
Suresh Voruganti
Comment 4
2011-02-28 07:49:37 PST
Please cherry pick the fix to Qtwebkit 2.1.x
Ademar Reis
Comment 5
2011-02-28 13:19:30 PST
I don't see the point of adding refactorings like this to a stable branch (qtwebkit-2.1.x). Removing from meta-bug. If it fixes a real problem, let me know.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug