Closed Bug 325381 Opened 19 years ago Closed 17 years ago

nsWebBrowserPersist::OnWalkDOMNode missing early return?

Categories

(Core :: DOM: Serializers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: Brade, Assigned: sciguyryan)

Details

(Keywords: perf)

Attachments

(1 file)

I was looking at nsWebBrowserPersist::OnWalkDOMNode today:

nsresult nsWebBrowserPersist::OnWalkDOMNode(nsIDOMNode *aNode)
{
  // Fixup xml-stylesheet processing instructions
  nsCOMPtr<nsIDOMProcessingInstruction> nodeAsPI = do_QueryInterface(aNode);
  if (nodeAsPI)
  {
    nsAutoString target;
    nodeAsPI->GetTarget(target);
    if (target.EqualsLiteral("xml-stylesheet"))
    {
      nsAutoString href;
      GetXMLStyleSheetLink(nodeAsPI, href);
      if (!href.IsEmpty())
      {
        StoreURI(NS_ConvertUCS2toUTF8(href).get());
      }
    }
  }

It seems like there should be a return NS_OK; after the StoreURI call as there is in the code below.  Is there a reason we don't return early?
Attached patch Patch v1Splinter Review
Patch v1

It should be fine to return any time inside the |nodeAsPI| node as far as I can see.
Assignee: adamlock → sciguyryan
Status: NEW → ASSIGNED
Attachment #265696 - Flags: superreview?(cbiesinger)
Attachment #265696 - Flags: review?(cbiesinger)
Attachment #265696 - Flags: superreview?(cbiesinger)
Attachment #265696 - Flags: superreview+
Attachment #265696 - Flags: review?(cbiesinger)
Attachment #265696 - Flags: review+
Whiteboard: [checkin needed]
Patch v1 checked in. Clearing checkin-needed status.
Whiteboard: [checkin needed]
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: