Last Comment Bug 550884 - Deadcode in nsWindow::SetParent for aNewParent = 0
: Deadcode in nsWindow::SetParent for aNewParent = 0
: coverity
Product: Core Graveyard
Classification: Graveyard
Component: Widget: Qt (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla7
Assigned To: Ed Morley [:emorley]
Depends on:
  Show dependency treegraph
Reported: 2010-03-08 07:46 PST by timeless
Modified: 2016-07-11 21:54 PDT (History)
5 users (show)
mounir: in‑testsuite-
See Also:
QA Whiteboard:
Iteration: ---
Points: ---

Remove dead code in nsWindow::SetParent (995 bytes, patch)
2011-05-30 09:11 PDT, Ed Morley [:emorley]
romaxa: review+
Details | Diff | Splinter Review

Description User image timeless 2010-03-08 07:46:14 PST
386 nsWindow::SetParent(nsIWidget *aNewParent)
387 {
388     NS_ENSURE_ARG_POINTER(aNewParent);

after this statement, aNewParent can't be null,

which means this statement is always true (and a waste of a comparison):
389     if (aNewParent) {

and all code flows through here:
390         nsCOMPtr<nsIWidget> kungFuDeathGrip(this);
and all code exits here:
405         return NS_OK;

which means none of the code from here:
406     }

to here is reachable:
418     return NS_OK;
Comment 1 User image Tobias Hunger 2011-01-17 02:53:34 PST
Valid points raised in this issue.

I am no longer involved with that code, so I reassigned the issue to the default person.
Comment 2 User image Ed Morley [:emorley] 2011-05-30 09:11:38 PDT
Created attachment 536112 [details] [diff] [review]
Remove dead code in nsWindow::SetParent

The code has since been partially rewritten by bug 449734 since comment 0, but some deadcode still remains.
Comment 3 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2011-05-30 14:53:44 PDT
Comment 4 User image Mounir Lamouri (:mounir) 2011-05-31 07:33:26 PDT
Comment 5 User image Vlad [QA] 2011-08-31 05:56:51 PDT
Setting resolution to Verified Fixed on Mozilla/5.0 (Windows NT 6.1; rv:7.0) Gecko/20100101 Firefox/7.0 beta 3

Note You need to log in before you can comment on or make changes to this bug.